This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients BTaskaya, levkivskyi, methane, 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:51methanesetrecipients: + methane, rhettinger, levkivskyi, remi.lapeyre, BTaskaya
2019-02-20 10:32:51methanesetmessageid: <1550658771.71.0.0499035926908.issue36042@roundup.psfhosted.org>
2019-02-20 10:32:51methanelinkissue36042 messages
2019-02-20 10:32:51methanecreate