On Thu, Nov 10, 2011 at 9:17 PM, Laurent <laurent.pa...@gmail.com> wrote: > Yes using a separate class variable would transfer the problem to the class > level. But adding 10 class variables if I have 10 properties would be ugly. > Maybe I should reformulate the subject of this thread to "is there some > python magic to pass parameters to decorator-declared properties ?"
Apparently, yes: >>> class Foo(object): ... @property ... def bar(self, arg1='baz', arg2='qux'): ... return arg1, arg2 ... >>> Foo.bar.fget(Foo(), 'spam', 'eggs') ('spam', 'eggs') >>> Though I do not like this trick at all. Cheers, Chris -- http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list