文档字符串。注意,是 __doc__ ,
前后各两个下划线。
一般而言,是对函数/方法/模块所实现功能的简单描述。但当指向具体对象时,会显示此对象从属的类型的构造函数的文档字符串。(示例见以下 a.__doc__)
>>> str.__doc__
"str(string[, encoding[, errors]]) -> str\n\nCreate a new string object from the given encoded string.\nencoding defaults to the current default string encoding.\nerrors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'."
>>> import math
>>> math.__doc__
'This module is always available. It provides access to the\nmathematical functions defined by the C standard.'
>>> a = [1]
>>> a.count.__do
一般而言,是对函数/方法/模块所实现功能的简单描述。但当指向具体对象时,会显示此对象从属的类型的构造函数的文档字符串。(示例见以下 a.__doc__)
>>> str.__doc__
"str(string[, encoding[, errors]]) -> str\n\nCreate a new string object from the given encoded string.\nencoding defaults to the current default string encoding.\nerrors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'."
>>> import math
>>> math.__doc__
'This module is always available. It provides access to the\nmathematical functions defined by the C standard.'
>>> a = [1]
>>> a.count.__do