[Python-ideas] Add lookahead iterator (peeker) to itertools

Serhiy Storchaka storchaka at gmail.com
Tue Feb 26 11:37:25 CET 2013


On 26.02.13 12:06, Masklinn wrote:
> Although I can trivially get a segfault with islice:
>
>      from itertools import islice, count
>
>      it = count()
>      while True:
>          it = islice(it, 0)
>
> Run this, C-c at some point, every CPython version on my machine
> segfaults (pypy does not)

Thank you. This looks as pretty same issue as with tee(). I knew that 
there must be more such catches, but could not find them.

http://bugs.python.org/issue17300





More information about the Python-ideas mailing list