Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

[Armin]
> It's just one of many places where CPython does a recursion 
> without checking the recursion depth.  CPython still works, 
> based on the resonable assumption that doing such a recursion
> here is obscure.

I agree with that assessment and am going to close this as something we can 
live with (or least have lived with successfully for a long time).  AFAICT, 
this situation doesn't arise in practical code.

It is possible to slow down the language by adding a variant of recursion 
checks to every call to an iterator.  But this just makes the language pay a 
code complexity cost and performance cost for something that doesn't really 
affect real users.  People typically choose itertools for their speed 
(otherwise, plain generators can be clearer).  We shouldn't work against the 
needs of those users.

A robust, clean, and performant solution wouldn't be easy but would likely 
involve some general purpose stack overflow protection that periodically makes 
sure there is enough stack remaining for C Python to function correctly.

----------
resolution:  -> wont fix
stage: needs patch -> resolved
status: open -> closed

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

Reply via email to