[docs] [issue14003] __self__ on built-in functions is not as documented
report at bugs.python.org
Sun Jun 7 20:10:23 CEST 2015
eryksun added the comment:
In Python 2 [Py_InitModule4] optionally allows setting __self__ on module functions, but no module in the standard library actually uses this. It's always None. This is no longer optional with Python 3's [PyModule_Create]. Built-in module functions instantiated the normal way can be considered as methods of the module in which they're defined. However, some modules may specially instantiate functions for which __self__ is None, such as codecs.strict_errors.
>>> codecs.strict_errors.__self__ is None
Python tracker <report at bugs.python.org>
More information about the docs