Message292064
| Author |
vstinner |
| Recipients |
mark.dickinson, rhettinger, serhiy.storchaka, terry.reedy, vstinner |
| Date |
2017年04月21日.16:34:42 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1492792482.94.0.0731594733187.issue29840@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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? |
|