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 rhettinger
Recipients BTaskaya, levkivskyi, remi.lapeyre, rhettinger
Date 2019-02-19.23:40:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550619631.05.0.603773151181.issue36042@roundup.psfhosted.org>
In-reply-to
Content
> CPython only makes these methods class method when a class created.
> If you set __class_getitem__ method after the creation it 
> doesn't work unless you use classmethod decorator manually.

Give the intended use case for __class_getitem__ and that it was replacement for metaclass code with the same effect, the current behavior doesn't seem unreasonable.  That said, I don't see any downside to allowing the method to attach after class creation.

Assigning to Ivan to make the call on this one.
History
Date User Action Args
2019-02-19 23:40:31rhettingersetrecipients: + rhettinger, levkivskyi, remi.lapeyre, BTaskaya
2019-02-19 23:40:31rhettingersetmessageid: <1550619631.05.0.603773151181.issue36042@roundup.psfhosted.org>
2019-02-19 23:40:31rhettingerlinkissue36042 messages
2019-02-19 23:40:30rhettingercreate