Proposed new PEP: print to expand generators

Roy Smith roy at panix.com
Sat Jun 3 22:02:29 EDT 2006


In article <mailman.6510.1149386134.27775.python-list at python.org>,
 "James J. Besemer" <jb at cascade-sys.com> wrote:

> I propose that we extend the semantics of "print" such that if the object to 
> be printed is a generator then print would iterate over the resulting 
> sequence of sub-objects and recursively print each of the items in order.

I believe the functionality you desire already exists, or something very 
close to it, in the pprint (pretty printer) module.



More information about the Python-list mailing list