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

2010-08-03 Thread Terry J. Reedy
Terry J. Reedy tjre...@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

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

2010-02-18 Thread Paul Boddie
Paul Boddie p...@boddie.org.uk added the comment: Actually, in the issue reported, the initial problem occurs in the evaluation of an object in a boolean context (and the subsequent problem occurs with an explicit len invocation):