Properties/Decorators [WAS: Can I reference 1 instance of an object by more names ? rephrase]

Wildemar Wildenburger wildemar at freakmail.de
Wed May 23 18:22:52 EDT 2007


Diez B. Roggisch wrote:
> It is that very apply.
>
> And apply takes a function as argument + additional arguments, and executes
> that function, returning the result of that function-call. It was used
> before the 
>
> f(*args, **kwargs)
>
> notation was introduced.
>
> Now what we have here is "value" as function, passed as single argument to
> apply (because decorators are just callables), which will invoke "value"
> with no arguments. The result of that operation is the property-object,
> that thus is returned by apply. And in the end gets assigned to the name
> value in the cpu_ports-class.
>   
Sooo clever :). But apply is deprecated ... can I do the same thing some 
other way?

W



More information about the Python-list mailing list