[New-bugs-announce] [issue21444] __len__ can't return big numbers

Ram Rachum report at bugs.python.org
Tue May 6 01:11:11 CEST 2014

New submission from Ram Rachum:

I want to use big numbers for length.

>>> class A:
...     __len__ = lambda self: 10 ** 20
>>> len(A())
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
OverflowError: cannot fit 'int' into an index-sized integer

components: Interpreter Core
messages: 217957
nosy: cool-RR
priority: normal
severity: normal
status: open
title: __len__ can't return big numbers
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list