[Python-Dev] pprint(iterator)
Oleg Broytmann
phd at phd.pp.ru
Thu Jan 29 17:23:17 CET 2009
On Thu, Jan 29, 2009 at 08:06:18AM -0800, Aahz wrote:
> On Thu, Jan 29, 2009, Michael Foord wrote:
> > Don't we have a pretty-print API - and isn't it spelled __str__ ?
>
> In theory, yes. In practice, we wouldn't be having this discussion if
> that really worked. But it probably would make sense to see how far
> using __str__ can take us -- AFAICT enumobject.c doesn't define __str__
> (although I may be missing something, I don't know Python at the C level
> very well).
Container objects (tuples/lists/dicts/sets) don't define __str__.
Is __pprint__ an attempt to redefine __str__?
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-Dev
mailing list