Author eryksun
Recipients Arfrever, SpecLad, anacrolix, docs@python, eryksun, ezio.melotti, merwok, michael.foord, r.david.murray, terry.reedy, vaultah
Date 2015-06-07.18:10:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1433700623.56.0.0396390927839.issue14003@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 2 [Py_InitModule4][1] 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][2]. 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
    True

[1]: https://docs.python.org/2/c-api/allocation.html#c.Py_InitModule4
[2]: https://docs.python.org/3/c-api/module.html#c.PyModule_Create
History
Date User Action Args
2015-06-07 18:10:23eryksunsetrecipients: + eryksun, terry.reedy, ezio.melotti, merwok, Arfrever, r.david.murray, michael.foord, anacrolix, docs@python, SpecLad, vaultah
2015-06-07 18:10:23eryksunsetmessageid: <1433700623.56.0.0396390927839.issue14003@psf.upfronthosting.co.za>
2015-06-07 18:10:23eryksunlinkissue14003 messages
2015-06-07 18:10:23eryksuncreate