From: Daneel Yaitskov on
Hi,



Everybody knows class's __str__ and __repr__ can be used to get readable
user representation of an object.


But for simple classes or debug aims it is tediously to code these
methods. And Python has very powerful reflection. I believe that
somebody has already written such library with this method.

I search library which can universally print state all not callable
attributes of an object. If object's attribute isn't int and float and
string and boolean and none then the method calls itself recursively.

Does this library exist?


Daneel Yaitskov.
From: Lie Ryan on
On 05/06/10 14:40, Daneel Yaitskov wrote:
> Hi,
>
>
>
> Everybody knows class's __str__ and __repr__ can be used to get readable
> user representation of an object.
>
>
> But for simple classes or debug aims it is tediously to code these
> methods. And Python has very powerful reflection. I believe that
> somebody has already written such library with this method.
>
> I search library which can universally print state all not callable
> attributes of an object. If object's attribute isn't int and float and
> string and boolean and none then the method calls itself recursively.

does dir() or printing __dict__ works for you?