[docs] [issue19441] itertools.tee improve documentation

Raymond Hettinger report at bugs.python.org
Wed Nov 6 21:36:15 CET 2013


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 <report at bugs.python.org>
<http://bugs.python.org/issue19441>
_______________________________________


More information about the docs mailing list