En Sun, 01 Mar 2009 15:51:07 -0200, Chris Rebert <c...@rebertia.com> escribió:
On Sun, Mar 1, 2009 at 8:54 AM, Gabriel Genellina
<gagsl-...@yahoo.com.ar> wrote:
En Sun, 01 Mar 2009 13:20:28 -0200, John O'Hagan <resea...@johnohagan.com>
escribió:

Inspired by some recent threads here about using classes to extend the
behaviour of iterators, I'm trying to replace some some top-level
functions
aimed at doing such things with a class.

I'm afraid you can't do that. There is no way of "cloning" a generator:

Really? What about itertools.tee()? Sounds like it'd do the job,
albeit with some caveats.
http://docs.python.org/library/itertools.html#itertools.tee

It doesn't clone the generator, it just stores the generated objects in a temporary array to be re-yielded later.

--
Gabriel Genellina

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

Reply via email to