* Jacob Abraham <[EMAIL PROTECTED]> [070419 10:08]:
> Hi Andreas Kostyrka,
> 
>    I am aware that property is a data descriptor. And I still don't see why 
> if can't be uses as a decorator since decorators were created to fix the 
> issue.
> 
> getx= property(getx)

Simple, they don't return function objects. Basically, function
objects (methods) do the __get__ protocol that property is doing to
make the self parameter binding.

decorators, if you expect them to work like normal methods do have
certain limits what they can return.

Ever wondered why practically all (well, I did it for a closed source
contract once differently) decorators are functions that return
interior nested functions, instead of returning callable object
instances? That's why.

Andreas
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to