115

类的特殊成员-Spider-Man-51CTO博客

 6 years ago
source link: http://blog.51cto.com/12730062/2066379
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
1、__doc__,表示类的描述信息执行结果:2、__module__,表示当前操作的对象在哪个模块,__class__,表示当前操作的对象的类是什么看一下输出结果:3、__call__,创建对象的时候是使用:对象=类名();而对于__call__方法的执行是由对象后面加括号来执行的,即:对象()4、__dict__,查看类或对象中的所有成员打印效果:输出类中的所有属性、方法,包括内置的属性方法;

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK