Author inada.naoki
Recipients BTaskaya, inada.naoki, levkivskyi, remi.lapeyre, rhettinger
Date 2019-02-20.10:32:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550658771.71.0.0499035926908.issue36042@roundup.psfhosted.org>
In-reply-to
Content
__new__ is special function too.  It is converted as staticmethod when class creation.

Since manually converting to (static|class)method is allowed, I don't think
automatic conversion should be applied when attach after class creation.

$ python3
Python 3.7.2 (default, Feb 12 2019, 08:15:36)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class C:
...   def __new__(cls):
...     pass
...
>>> type(C.__dict__['__new__'])
<class 'staticmethod'>
>>> class D:
...   pass
...
>>> D.__new__ = lambda cls: cls
>>> type(D.__dict__['__new__'])
<class 'function'>
History
Date User Action Args
2019-02-20 10:32:51inada.naokisetrecipients: + inada.naoki, rhettinger, levkivskyi, remi.lapeyre, BTaskaya
2019-02-20 10:32:51inada.naokisetmessageid: <1550658771.71.0.0499035926908.issue36042@roundup.psfhosted.org>
2019-02-20 10:32:51inada.naokilinkissue36042 messages
2019-02-20 10:32:51inada.naokicreate