"Lawrence D’Oliveiro" <lawrenced...@gmail.com> a écrit dans le message de
news:f5314bdd-a98f-4a16-b546-bd8efe4dd...@googlegroups.com...
On Thursday, October 6, 2016 at 7:54:08 PM UTC+13, ast wrote:
But there is no decorator, why ? Is python doing the conversion
of funct2 to a descriptor itself, behind the scene ?
Every function is already a descriptor. So you get the instance-method
behaviour automatically.
* static methods are decorated too
This is to turn off the instance-method behaviour.
I do not understand your answer.
Consider this function:
def add(a, b):
return a+b
You say that a function is always stored as
a descriptor object, so when I execute
sum = f(4, 6)
from which class it is supposed to come from ?
--
https://mail.python.org/mailman/listinfo/python-list