anthony shaw <anthony.p.s...@gmail.com> added the comment:

> This might cause a MemoryError when the __length_hint__ of the source returns 
> a too large value, even when the actual size of the comprehension is smaller, 
> e.g.:

The current implementation of list comprehensions raise neither a memoryerror 
or overflow error. They will consume all available memory and crash the 
interpreter.

This patch raises an OverflowError before execution instead of just looping 
until memory heap exhaustion

----------

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

Reply via email to