[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-03-11 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-20 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I totally agree with Serhiy -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't like complicating the code and adding a performance penalty to support such uncommon case. The documentation for __class_getitem__ precisely describes the current behavior: "when defined in the class body, this method is implicitly a class

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-20 Thread INADA Naoki
INADA Naoki added the comment: __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

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-19 Thread Raymond Hettinger
Raymond Hettinger 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

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-19 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Is this an issue though? Shouldn't methods be defined in the class definition, we don't expect setting a function as an attribute to a class to transform it automatically to a method. Why would we special case __class_getitem__ and not __init_subclass__?

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-19 Thread BTaskaya
Change by BTaskaya : -- keywords: +patch pull_requests: +11967 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-19 Thread BTaskaya
New submission from BTaskaya : 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 ...