[Python-3000] Types and classes
Greg Ewing
greg.ewing at canterbury.ac.nz
Tue Apr 8 03:50:47 CEST 2008
Guido van Rossum wrote:
> what do people think of making the str() of a class
> return just the thing between '...' in the repr()?
Are you talking about the class itself, or instances
of the class?
If the latter, I'm not sure I like that idea. Very
often I write thing like 'print "foo =", foo' as
debugging statements, relying on the fact that
str(foo) will give me a repr, since it doesn't have
a __str__ of its own.
If that changes, I'll have to print repr(foo) or
"%r" % foo a lot more often instead, which would
be tedious.
--
Greg
More information about the Python-3000
mailing list