gabriel, 10.02.2012 19:00:
> If I cythonize the following class:
>
> class Foo(object):
> def __getitem__(self, index):
> print index
> def test_getitem(self):
> self[2:]
>
> and use it, e.g. in a module called 'test' in e.g. Ipython, then I get
> the following behavior:
>
> In [1]: import test
>
> In [2]: test.Foo()[2:]
> slice(2, None, None)
>
> In [3]: test.Foo().test_getitem()
> slice(2, 9223372036854775807, None)
>
> Thus, using getitem in compiled code gives an incorrect slice. Or am I
> missing something?
Yes, that's a long-standing known bug.
http://trac.cython.org/cython_trac/ticket/636
Stefan