pprinting objects

Donn Ingle donn.ingle at gmail.com
Sat Dec 8 05:16:57 EST 2007


Hi,
 Is there a way to get a dump of the insides of an object? I thought pprint
would do it. If I had a class like this:

class t:
 def __init__(self):
  self.x=1
  self.y=2
  self.obj = SomeOtherObj()

Then it could display it as:

<class> t,
 x,1,
 y,2,
 obj,<class SomeOtherObj>

Or something like that -- a complete output of the object really, with
id()'s and so forth.


\d




More information about the Python-list mailing list