[Python-Dev] Make class_getitem a class method (original) (raw)

Serhiy Storchaka storchaka at gmail.com
Fri Dec 15 13:35:46 EST 2017


15.12.17 20:02, Yury Selivanov пише:

But nobody decorates new with a @staticmethod. And making classgetitem 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 classgetitem in C one should add it as METHSTATIC. I also think we should merge your PR that tests that it works the way it's expected.

In this case I suggest to make class_getitem an automatic class method like init_subclass.

The number of special cases bothers me.



More information about the Python-Dev mailing list