pprinting objects

Donn Ingle donn.ingle at gmail.com
Sat Dec 8 07:58:57 EST 2007


> Define a __repr__ or __str__ method for the class
Yes, then I could include the code John Machin suggested in there:

for attr, value in sorted(self.__dict__.iteritems()): blah

That will do nicely. Thanks all.

\d





More information about the Python-list mailing list