On May 23, 6:22 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > 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
Yes; check out the following: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502243 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410698 George -- http://mail.python.org/mailman/listinfo/python-list