Raymond Hettinger added the comment:

I don't want to recommend overwriting the variable name but will add a note for 
the rest:

"Copied iterators depend the original iterator. If the original advances, then 
so do the copies.  After teeing the iterators, the usual practice is
to stop working with the original iterator and operate only on the new tee-ed 
iterators."

FWIW, the situation is analogous to str.upper().  We note that string methods 
produce new strings.  We don't state that a best practice is to overwrite the 
variable with "s = s.upper()".  That is sometimes what you want and sometimes 
not.

----------
priority: normal -> low

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to