Message15512
Logged In: YES
user_id=80475
Russ, you're right about there being two behaviors for the
implementation of the slice notation(see apply_slice() in
Python/ceval.c). This occurs in the bytecode interpreter
rather than some object's implementation of __getitem__.
While it is unfortunate, it can't be fixed without breaking
code which defines __getitem__ but doesn't provide a None-
to-zero converter.
Factiod of the day, interpreter doesn't just assume 0 for
None, it clamps the values in a range of 0<= value <=
sys.maxint:
>>> class C:
def __getitem__(self, i):
return i
>>> c = C()
>>> c[10000000000000000000L:]
slice(2147483647, 2147483647, None)
I recommend you close the bug as Won't Fix. |
|
Date |
User |
Action |
Args |
2007-08-23 14:12:33 | admin | link | issue723806 messages |
2007-08-23 14:12:33 | admin | create | |
|