Message292121
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). |
|
Date |
User |
Action |
Args |
2017-04-22 15:18:18 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, terry.reedy, mark.dickinson, vstinner |
2017-04-22 15:18:18 | serhiy.storchaka | set | messageid: <1492874298.57.0.148487490346.issue29840@psf.upfronthosting.co.za> |
2017-04-22 15:18:18 | serhiy.storchaka | link | issue29840 messages |
2017-04-22 15:18:18 | serhiy.storchaka | create | |
|