Terry Reedy wrote:
> "James J. Besemer" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> 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.
> Iterating over an iterator is usually destructive.  So you would be 
> printing what it was but no longer is.  This is why iterators are printed 
> differently from sequences.

I guess the motivation is the case of people who would set 
up an iterator specifically to print from it.

print-as-debug-aid would get badly broken by the proposal, 
and I'd find that painful.

         Mel.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to