Jeroen Demeyer <j.deme...@ugent.be> added the comment:

I'm certainly in favor of adding a way for infinite iterators to state that 
they are infinite. I just feel like TypeError is way overused in Python. I also 
disagree that it's a category error: it's an iterable, so it does make sense to 
ask for its length.

You should also consider that there may be classes of iterables whose instances 
are sometimes finite and sometimes infinite. Then it's certainly not a category 
error.

So I would like a specific answer for "I'm infinite". If you don't like 
OverflowError, other options are ArithmeticError, IndexError, ValueError or 
simply returning math.inf

----------

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

Reply via email to