In Python2.5:
PyAPI_FUNC(int) PySet_Clear(PyObject *set);
PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key);
PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
PyAPI_FUNC(int) _PySet_Next(PyObject *set, Py_ssize_t *pos, PyObject **key);
PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos,
PyObject **key, long *hash);
PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set);
PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);

then you should use (check it!!!)

"clear", "O", "i", "PySet_Clear"

"discard", "OO", "i", "PySet_Discard"

"add "OO", "i", "PySet_Add"

"pop", "O", "O", "PySet_Pop"



On Wed, Oct 1, 2008 at 6:29 PM, Robert Bradshaw
<[EMAIL PROTECTED]> wrote:
> On Oct 1, 2008, at 2:25 PM, didier deshommes wrote:
>
>> On Wed, Oct 1, 2008 at 5:17 PM, Robert Bradshaw
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> You could look at how list and dict are handled at the bottom of
>>>
>>> http://hg.cython.org/cython-devel/file/c9f3badef047/Cython/Compiler/
>>> Builtin.py
>>
>> Hi Robert,
>> What is the meaning of lines like this:
>> ("append", "OO",   "i", "PyList_Append")
>>
>> I'm especially curious about the "OO" and "i" stuff.
>
> "OO" means PyList_Append takes two arguments of type O = object. "i"
> means the return value is an int (for error checking, never actually
> revealed to Python).
>
>> Is this the only code change needed to map these calls?
>
> Yep, it's that easy now that we have support for this kind of thing.
> Looking forward to a patch :).
>
> - Robert
>
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to