Slice endpoints invisibly truncated
>>> class Potato(object): ... def __getslice__(self, start, stop): ... print start, stop ... >>> sys.maxint 9223372036854775807 >>> x = sys.maxint + 69 >>> print x 9223372036854775876 >>> Potato()[123:x] 123 9223372036854775807 Why the call to getslice doesn't respect the stop I sent in, instead silently substituting 2^63 - 1? Does it mean that implementing __getslice__ for your own syntax will generally be unsafe with longs? I can do whatever I need with __getitem__ anyway, I'm just wondering why __getslice__ is apparently broken. Edit: Where is the code in CPython which truncates the slice?