On 16 июл, 11:32, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Tue, 15 Jul 2008 19:54:30 -0700, Yosifov Pavel wrote:
> > Kay, can you show example of such generator? ReIter, for example, work
> > with usual generators.
>
> > But for "big" iterator, I think is no any good solutions. IMHO
On Tue, 15 Jul 2008 19:54:30 -0700, Yosifov Pavel wrote:
> Kay, can you show example of such generator? ReIter, for example, work
> with usual generators.
>
> But for "big" iterator, I think is no any good solutions. IMHO we can
> discern 2 types of iterators: re-startable (based on internal Pyth
Kay, can you show example of such generator? ReIter, for example, work
with usual generators.
But for "big" iterator, I think is no any good solutions. IMHO we can
discern 2 types of iterators: re-startable (based on internal Python
objects) and not re-startable (with an external state, side-
effe
On 15 Jul., 08:16, Yosifov Pavel <[EMAIL PROTECTED]> wrote:
> cloning of iterators in this manner is bad, more good is to use one,
> single list(my_iter) instead of
> (seehttp://aquagnu.blogspot.com/2008/07/self-repair-iterator-in-python.html).
This won't work for "big" iterators as mentioned by
On 14 июл, 23:36, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 13 juil, 12:05, Yosifov Pavel <[EMAIL PROTECTED]> wrote:
> (snip)
>
> > defcloneiter( it ):
> > """return (clonable,clone)"""
> > return tee(it)
>
> This might as well be written as
>
> cloneiter = tee
>
> Or yet better,
On 13 Jul., 08:53, Yosifov Pavel <[EMAIL PROTECTED]> wrote:
> Whats is the way to clone "independent" iterator? I can't use tee(),
> because I don't know how many "independent" iterators I need. copy and
> deepcopy doesn't work...
>
> --pavel
You can try generator_tools
http://pypi.python.org/pyp
On 13 juil, 12:05, Yosifov Pavel <[EMAIL PROTECTED]> wrote:
(snip)
> def cloneiter( it ):
> """return (clonable,clone)"""
> return tee(it)
This might as well be written as
cloneiter = tee
Or yet better, just remove the above code and s/cloneiter/tee/g in the
remaining...
--
http://mai
> `tee()` doesn't copy the iterator or its internal state but just caches
> it's results, so you can iterate over them again. That makes only sense
> if you expect to use the two iterators in a way they don't get much out of
> sync. If your usage pattern is "consume iterator 1 fully, and then
> r
On Sun, 13 Jul 2008 18:51:19 -0700, Yosifov Pavel wrote:
>> Well, I think Python's iterators, especially the generators, are beautiful.
>> More importantly, I think there is no general way to make iterators
>> copyable, regardless of the programming language. The problem is that most
>> of the use
> Well, I think Python's iterators, especially the generators, are beautiful.
> More importantly, I think there is no general way to make iterators
> copyable, regardless of the programming language. The problem is that most
> of the useful ones depend on external state.
>
> Peter
Hmm, but tee() d
Yosifov Pavel wrote:
> On 13 июл, 14:12, Peter Otten <[EMAIL PROTECTED]> wrote:
>> Yosifov Pavel wrote:
>> > Whats is the way to clone "independent" iterator? I can't use tee(),
>> > because I don't know how many "independent" iterators I need. copy and
>> > deepcopy doesn't work...
>>
>> There is
On 13 июл, 14:12, Peter Otten <[EMAIL PROTECTED]> wrote:
> Yosifov Pavel wrote:
> > Whats is the way to clone "independent" iterator? I can't use tee(),
> > because I don't know how many "independent" iterators I need. copy and
> > deepcopy doesn't work...
>
> There is no general way. For "short" s
Yosifov Pavel wrote:
> Whats is the way to clone "independent" iterator? I can't use tee(),
> because I don't know how many "independent" iterators I need. copy and
> deepcopy doesn't work...
There is no general way. For "short" sequences you can store the items in a
list which is also the worst-
Whats is the way to clone "independent" iterator? I can't use tee(),
because I don't know how many "independent" iterators I need. copy and
deepcopy doesn't work...
--pavel
--
http://mail.python.org/mailman/listinfo/python-list
14 matches
Mail list logo