This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients mark.dickinson, vstinner
Date 2021-03-31.14:44:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Seems like a duplicate of #20309.

My usecase is to avoid any behavior difference between and functions: PEP 399 "Pure Python/C Accelerator Module Compatibility Requirements". Currently, this is a very subtle difference when it's used to define a method.

I dislike the current _pyio.OpenWrapper "hack". I would prefer that would be directly usable to define a method. I propose to use @staticmethod, but I am open to other ideas. It could be a new decorator: @staticmethod_or_function.

Is it worth it to introduce a new @staticmethod_or_function decorator just to leave @staticmethod unchanged?

Note: The PEP 570 "Python Positional-Only Parameters" (implemented in Python 3.8) removed another subtle difference between functions implemented in C and functions implemented in Python. Now functions implemented in Python can only have positional only parameters.
Date User Action Args
2021-03-31 14:44:15vstinnersetrecipients: + vstinner, mark.dickinson
2021-03-31 14:44:15vstinnersetmessageid: <>
2021-03-31 14:44:15vstinnerlinkissue43682 messages
2021-03-31 14:44:15vstinnercreate