This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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?
History
Date User Action Args
2017-04-21 16:34:42vstinnersetrecipients: + vstinner, rhettinger, terry.reedy, mark.dickinson, serhiy.storchaka
2017-04-21 16:34:42vstinnersetmessageid: <1492792482.94.0.0731594733187.issue29840@psf.upfronthosting.co.za>
2017-04-21 16:34:42vstinnerlinkissue29840 messages
2017-04-21 16:34:42vstinnercreate