[issue43682] Make static methods created by @staticmethod callable

Serhiy Storchaka report at bugs.python.org
Sat Apr 10 04:39:05 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

> Do you see a way to make C functions and Python functions behave the same?

Implement __get__ for C functions.

Of course it is breaking change so we should first emit a warning. It will force all users to use staticmethod explicitly if they set a C function as a class attribute. We can also start emitting warnings for all callable non-descriptor class attributes.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43682>
_______________________________________


More information about the Python-bugs-list mailing list