python reflection getattr (objects 'methods') () and the hasattr (objects 'methods')

getattr (objects 'methods') (): a method to find the object from inside the inside ,,,

Pass an object, and transmits a string, the string will be able to find ways

the hasattr (objects 'methods') determine the object of this method there is no return True and False

 

Used in the inside of the class

 

 

 

 



Guess you like

Origin www.cnblogs.com/mihoutao/p/10974895.html