[issue22939] integer overflow in iterator object

Ronald Oussoren report at bugs.python.org
Tue Dec 30 12:50:39 CET 2014


Ronald Oussoren added the comment:

Is it necessary to raise when it_index is PY_SSIZE_T_MAX? 

An alternative is to set it_index to -1 when there would be overflow and raise an exception on the next call to next(). That way a virtual sequence with PY_SSIZE_T_MAX-1 items would still work (instead of failing unexpectedly).

----------
nosy: +ronaldoussoren

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22939>
_______________________________________


More information about the Python-bugs-list mailing list