[issue32332] Implement slots support for magic methods added in PEP 560

2017-12-15 Thread Yury Selivanov
Yury Selivanov added the comment: Serhiy, I've tested METH_STATIC approach and it works just fine. Thanks for pointing that out! I agree that adding slots for something that's already possible is an overkill, so let's close this issue. -- resolution: ->

[issue32332] Implement slots support for magic methods added in PEP 560

2017-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 4883 shows how magic methods for PEP 560 can be implemented without introducing new slots. -- ___ Python tracker

[issue32332] Implement slots support for magic methods added in PEP 560

2017-12-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This isn't so easy. You can't just access new slot, because this is binary incompatible. You should add new type flag, say Py_TPFLAGS_HAVE_CLASS, set it for all classes with tp_as_class, and guard access to tp_as_class with

[issue32332] Implement slots support for magic methods added in PEP 560

2017-12-14 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +4772 stage: -> patch review ___ Python tracker ___

[issue32332] Implement slots support for magic methods added in PEP 560

2017-12-14 Thread Yury Selivanov
New submission from Yury Selivanov : I propose to add type slots for magic methods introduced by PEP 560. In the brief discussion on the mailing list Guido OK'd the idea: https://mail.python.org/pipermail/python-dev/2017-December/151262.html I'll submit a PR that