反射的简单应用

详见文章
https://www.cnblogs.com/0xiasandu/p/11375980.html

1. hasattr(obj,"func")

2. getattr(obj,"name")

3. setattr(obj,"name","三太子")

4. delattr(obj,"age")

你可能感兴趣的:(反射的简单应用)