[issue7942] Inconsistent error types/messages for __len__ (and __nonzero__) between old and new-style classes

Terry J. Reedy report at bugs.python.org
Wed Aug 4 05:56:56 CEST 2010


Terry J. Reedy <tjreedy at udel.edu> added the comment:

The exceptions cannot change in 2.7.

For 3.1.2
class C:
    def __len__(self):
            return 2**35
c = C()
len(c)
# gives
OverflowError: cannot fit 'int' into an index-sized integer

Maybe (#2690) that will change.

So I do not see any valid bug or feature request issue.

----------
nosy: +tjreedy
resolution:  -> invalid
status: open -> closed
versions: +Python 2.7 -Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7942>
_______________________________________


More information about the Python-bugs-list mailing list