Re: listing all property variables of a class instance

2007-06-25 Thread André
On Jun 25, 2:09 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-06-25, André <[EMAIL PROTECTED]> wrote: > > > > > Suppose I define a class with a number of variables defined as > > properties. Something like: > > > class MyClass(object): > > > def __init__(self): > > self.some_va

Re: listing all property variables of a class instance

2007-06-25 Thread Gabriel Genellina
En Mon, 25 Jun 2007 15:10:25 -0300, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> escribió: > 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 >>>

Re: listing all property variables of a class instance

2007-06-25 Thread Marc 'BlackJack' Rintsch
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

Re: listing all property variables of a class instance

2007-06-25 Thread Jay Loden
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.__di

Re: listing all property variables of a class instance

2007-06-25 Thread Neil Cerutti
On 2007-06-25, André <[EMAIL PROTECTED]> wrote: > Suppose I define a class with a number of variables defined as > properties. Something like: > > class MyClass(object): > > def __init__(self): > self.some_variable = 42 > self._a = None > self._b = "pi" > > def get_