[issue33939] Raise TypeError in __length_hint__ for consistently infinite iterators

Jeroen Demeyer report at bugs.python.org
Fri Jun 22 09:54:02 EDT 2018


Jeroen Demeyer <J.Demeyer at UGent.be> added the comment:

By the way, there is a precedent for OverflowError on infinities:

>>> import math
>>> int(math.inf)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: cannot convert float infinity to integer

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33939>
_______________________________________


More information about the Python-bugs-list mailing list