[Python-Dev] pprint(iterator)

Raymond Hettinger python at rcn.com
Fri Jan 30 02:15:54 CET 2009


 
> Along the lines of what others have said: pprint() cannot consume an
> unknown iterator.  

Perhaps so.  It's nice to have printing be free of side-effects (other than
the actual printing).

I've been working with 3.0 daily for several months (on a book project)
and mostly think it's great.  But sooner or later, we're going to have to 
address the issue about iterator reprs at the interactive prompt.  This is a 
separate and more general issue than pprint().  My experience so far is that 
it is that the shift to more things being unviewable at the prompt is bit frustrating
and makes the language more opaque.  If that has been a source of irritation
to me, then it will likely be more acutely felt by people who are starting out
and are using the interactive prompt to explore the language.

I don't know the right answer here (perhaps an alternate sys.displayhook).
Just wanted to provide some early feedback based on my experiences
heavily exercising 3.0.


Raymond


P.S.  My other experience with 3.0 is that my most frequent error has
changed.  It used to be that the number reason for my getting a syntax
error was leaving-off a colon.  Now, my number one reason is
omitting parens in a print() function call.  I thought I would get used to
it quickly, but it still comes up several times a day.




More information about the Python-Dev mailing list