Message202286
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. |
|
Date |
User |
Action |
Args |
2013-11-06 20:36:15 | rhettinger | set | recipients:
+ rhettinger, docs@python, Alan.Cristhian |
2013-11-06 20:36:15 | rhettinger | set | messageid: <1383770175.2.0.144446553169.issue19441@psf.upfronthosting.co.za> |
2013-11-06 20:36:15 | rhettinger | link | issue19441 messages |
2013-11-06 20:36:14 | rhettinger | create | |
|