Message292064
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? |
|
Date |
User |
Action |
Args |
2017-04-21 16:34:42 | vstinner | set | recipients:
+ vstinner, rhettinger, terry.reedy, mark.dickinson, serhiy.storchaka |
2017-04-21 16:34:42 | vstinner | set | messageid: <1492792482.94.0.0731594733187.issue29840@psf.upfronthosting.co.za> |
2017-04-21 16:34:42 | vstinner | link | issue29840 messages |
2017-04-21 16:34:42 | vstinner | create | |
|