Re: C api question and determining PyObject type

2009-11-16 Thread Gabriel Genellina
En Mon, 16 Nov 2009 07:44:34 -0300, lallous escribió: Actually, the object class is defined as: class __object(object): def __getitem__(self, idx): return getattr(self, idx) Anyway, now I check like this: bool PyIsSequenceType(PyObject *obj) { if (!PySequence_Check(o

Re: C api question and determining PyObject type

2009-11-16 Thread Gabriel Genellina
En Mon, 16 Nov 2009 07:44:34 -0300, lallous escribió: Actually, the object class is defined as: class __object(object): def __getitem__(self, idx): return getattr(self, idx) Anyway, now I check like this: bool PyIsSequenceType(PyObject *obj) { if (!PySequence_Check(o

Re: C api question and determining PyObject type

2009-11-16 Thread lallous
Actually, the object class is defined as: class __object(object): def __getitem__(self, idx): return getattr(self, idx) Anyway, now I check like this: bool PyIsSequenceType(PyObject *obj) { if (!PySequence_Check(obj)) return false; Py_ssize_t sz = PySequence_Size(obj);