Re: [Python-Dev] Make __class_getitem__ a class method

2017-12-15 Thread Ivan Levkivskyi
On 15 December 2017 at 19:35, Serhiy Storchaka wrote: > 15.12.17 20:02, Yury Selivanov пише: > >> But nobody decorates __new__ with a @staticmethod. And making >> __class_getitem__ a @classmethod will only confuse users -- that's all >> I'm saying. >> >> So I'm +1 to keep

Re: [Python-Dev] Make __class_getitem__ a class method

2017-12-15 Thread Eric Snow
On Fri, Dec 15, 2017 at 11:35 AM, Serhiy Storchaka wrote: > In this case I suggest to make __class_getitem__ an automatic class method > like __init_subclass__. +1 I was just about to suggest the same thing. -eric ___ Python-Dev

Re: [Python-Dev] Make __class_getitem__ a class method

2017-12-15 Thread Serhiy Storchaka
15.12.17 20:02, Yury Selivanov пише: But nobody decorates __new__ with a @staticmethod. And making __class_getitem__ a @classmethod will only confuse users -- that's all I'm saying. So I'm +1 to keep the things exactly as they are now. It would be great do document that in order to implement

Re: [Python-Dev] Make __class_getitem__ a class method

2017-12-15 Thread Yury Selivanov
On Fri, Dec 15, 2017 at 12:45 PM, Serhiy Storchaka wrote: > 15.12.17 18:47, Yury Selivanov пише: >> >> Shouldn't we optimize the usability for pure-Python first, and then for C >> API? >> >> Right now we have the '__new__' magic method, which isn't a >> @classmethod. Making

Re: [Python-Dev] Make __class_getitem__ a class method

2017-12-15 Thread Serhiy Storchaka
15.12.17 18:47, Yury Selivanov пише: Shouldn't we optimize the usability for pure-Python first, and then for C API? Right now we have the '__new__' magic method, which isn't a @classmethod. Making '__class_getitem__' a @classmethod will confuse regular Python users. For example: class

Re: [Python-Dev] Make __class_getitem__ a class method

2017-12-15 Thread Ivan Levkivskyi
On 15 December 2017 at 17:47, Yury Selivanov wrote: > Shouldn't we optimize the usability for pure-Python first, and then for C > API? > > Right now we have the '__new__' magic method, which isn't a > @classmethod. Making '__class_getitem__' a @classmethod will confuse

Re: [Python-Dev] Make __class_getitem__ a class method

2017-12-15 Thread Yury Selivanov
Shouldn't we optimize the usability for pure-Python first, and then for C API? Right now we have the '__new__' magic method, which isn't a @classmethod. Making '__class_getitem__' a @classmethod will confuse regular Python users. For example: class Foo: def __new__(cls, ...): pass

Re: [Python-Dev] Make __class_getitem__ a class method

2017-12-15 Thread Ivan Levkivskyi
I like this idea. I have few suggestions for the test cases you added, will add them a bit later in the PR. -- Ivan On 15 December 2017 at 16:00, Serhiy Storchaka wrote: > The class itself always is passed as the first argument to > __class_getitem__(): > >