On 12/28/11 1:01 PM, roze...@volny.cz wrote:
Dear Robert,

thank you very much for your answer. I understand what you mean and
I have looked at slice object and C-api methods it provides. It
should be easy to implement it.

The only question is how exactly yo implement the general getter,
since sq_item you mention (assume you mean
PySequenceMethods.sq_item) has the following signature:

PyObject * (* ssizeargfunc)(PyObject *, Py_ssize_t)

accepting Py_ssize_t as the index, not a PyObject * which would hold
the slice.

So, how exactly to implement the getter? As a general method named
__getitem__ registered in PyMethodDef? Or in another way?

Sorry, PyMappingMethods.mp_subscript is the general function that you need to implement.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to