In <[EMAIL PROTECTED]>, Jay Loden wrote: > > Neil Cerutti wrote: >>> Is there a way to write a method that would list automatically >>> all the variables defined as a property (say by printing their >>> docstring and/ or their value), and only those variables? >> >> This is off the cuff. There's likely a better way. >> >> for k, v in MyClass.__dict__.iteritems(): >> if isinstance(v, property): >> print k, v.__doc__ >> > > The only way I could get this to work was to change the way the > properties were defined/initalized:
That's because you iterate over the instance's `__dict__` and not over the *class* `__dict__` like Neil does. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list