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 serhiy.storchaka
Recipients mark.dickinson, rhettinger, serhiy.storchaka, terry.reedy, vstinner
Date 2017-04-22.15:18:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492874298.57.0.148487490346.issue29840@psf.upfronthosting.co.za>
In-reply-to
Content
I had similar doubts about this patch and needed opinions of other core developers.

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

Following patch implements this idea. I don't like it because it is too complicated.

I think that we should either document that raising an OverflowError by __len__() is normal and interpreted as true in Boolean context, or document that __len__() should return a value not larger than sys.maxsize, otherwise len() and bool() can raise an OverflowError (see issue15718).
History
Date User Action Args
2017-04-22 15:18:18serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, terry.reedy, mark.dickinson, vstinner
2017-04-22 15:18:18serhiy.storchakasetmessageid: <1492874298.57.0.148487490346.issue29840@psf.upfronthosting.co.za>
2017-04-22 15:18:18serhiy.storchakalinkissue29840 messages
2017-04-22 15:18:18serhiy.storchakacreate