STINNER Victor added the comment:

Hum, I dislike this change since it's non-obvious what/who is raising the 
OverflowError. If an object calls a function in __len__() and the function 
raises OverflowError, should we consider that object is "true"? In temptation 
to guess, I prefer to not guess but passthrough the exception.

If you want to support bool(range(1<<1000)), we need to get the result of 
__len__() as a Python object rather than a C Py_ssize_t.

Maybe, if __len__() raises an OverflowError: call again the len(), but using 
the "__len__" method instead of the slot?

----------

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

Reply via email to