Author BTaskaya
Recipients BTaskaya
Date 2019-02-19.17:19:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550596795.62.0.0325313661294.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.

>>> class B:
...     pass
... 
>>> def y(*a, **k):
...     return a, k
... 
>>> B.__class_getitem__ = y 
>>> B[int]
((<class 'int'>,), {})
>>> B.__class_getitem__ = classmethod(y)
>>> B[int]
((<class '__main__.B'>, <class 'int'>), {})
History
Date User Action Args
2019-02-19 17:19:55BTaskayasetrecipients: + BTaskaya
2019-02-19 17:19:55BTaskayasetmessageid: <1550596795.62.0.0325313661294.issue36042@roundup.psfhosted.org>
2019-02-19 17:19:55BTaskayalinkissue36042 messages
2019-02-19 17:19:55BTaskayacreate