Message 76623 - Python tracker (original) (raw)
I'm just curious to know which is the right behavior.
Python 3.0
Traceback (most recent call last): File "bad_range.py", line 7, in print(range(MyInt(23), MyInt(23+10))) TypeError: 'MyInt' object cannot be interpreted as an integer
Python 2.7a0
[8, 9, 10, 11, 12, 13, 14, 15, 16, 17] here [18446744073709551616L, 18446744073709551617L, 18446744073709551618L, 18446744073709551619L, 18446744073709551620L, 18446744073709551621L, 18446744073709551622L, 18446744073709551623L, 18446744073709551624L, 18446744073709551625L] Traceback (most recent call last): File "bad_range.py", line 11, in print(range(MyInt(264), MyInt(264+10))) TypeError: range() integer start argument expected, got instance.