反射的简单应用
2019-08-19 本文已影响0人
0xiasandu
详见文章
https://www.cnblogs.com/0xiasandu/p/11375980.html
1. hasattr(obj,"func")
2. getattr(obj,"name")
3. setattr(obj,"name","三太子")
4. delattr(obj,"age")
详见文章
https://www.cnblogs.com/0xiasandu/p/11375980.html
1. hasattr(obj,"func")
2. getattr(obj,"name")
3. setattr(obj,"name","三太子")
4. delattr(obj,"age")