Re: [Python-ideas] Add the method decorator
12 Apr
2018
12 Apr
'18
10:32 a.m.
On 2018-04-12 15:57, Serhiy Storchaka wrote:
There is a difference between functions implemented in Python and C. Functions implemented in Python are descriptors. They can be used for defining methods in Python classes. Functions implemented in C are not descriptors. When set a class attribute to a functions implemented in C, it will not become a bound method.
As it happens, the recently-created PEP 575 allows creating functions in C which behave more like Python functions. It doesn't fix your use case with existing functions implemented in C or arbitrary callables but PEP 575 would fix your use case for user-implemented C functions.
2203
Age (days ago)
2203
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jeroen Demeyer