Bastien Montagne added the comment:

Yes, itertools.tee just keep in memory elements produced by the "most advanced" 
iterator, until the "least advanced" iterator consumes them. It may not be a 
big issue in most cases, but I can assure you that when you have to iter 
several times over a million of vertices, this is not a good solution… ;)

Fortunately, in this case I can just produce several times the same generator, 
but still, would be nicer (at least on the “beauty of the code” aspect) if 
there was a way to really duplicate generators.

Unless I misunderstood things, and deepcopying a generator would imply to also 
copy its whole source of data?

----------

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

Reply via email to