Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> 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.

----------
assignee:  -> levkivskyi
components: +Interpreter Core
nosy: +rhettinger
type: behavior -> enhancement
versions: +Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36042>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to