On Thu, Oct 2, 2008 at 5:25 PM, didier deshommes <[EMAIL PROTECTED]> wrote:
>
> Cython fails with a syntax error on "cdef set s". As an aside, if you
> have this in py2.3:
>
> """
> #py 2.3
> cdef object s
> s =set()
> """

OK, that's a bit strange, but should be related to the fact that
Cython access the builtin module (I remember a post from Dag about
this issue). IMHO, a 'cdef set s' should not fail with a syntax error.

> Everything will compile fine but the module will fail to load when you
> try to import it with this message:
> "undefined symbol: PySet_Type". That's because Symtab.py assumes that
> sets are available in py2.3 also, and includes it in `builtin_entries`
> (a dict).Should we work around that or should we let users shoot
> themselves in the foot?

This is expected and we are fine with that.

>>> I also had to modify  PyrexTypes.py to make
>>> sure that PyAnySet_CheckExact() was being passed, instead of
>>> PySet_CheckExact() (there are 2 ways to check for the type of a set:
>>> PyAnySet_CheckExact and PyFrozenSet_CheckExact). Reviews welcome!
>>
>> Your patch seems fine, but I believe the fix for 'type_test_code()'
>> method is wrong for the case of 'frozenset', 'frozenset'.capitalize()
>> -> 'Frozenset', and you need 'FrozenSet', right? I would add these two
>> lines
>>
>> elif type == 'Frozenset'
>>    type = 'FrozenSet'
>
> Right.
>
>>
>> As a final note, It would be great if you could also provide a test
>> (pyx file for compile and run) for all this!
>
> Ok, will do.
>

OK, send the final patch (and possibly the test cases) when you finish it.


-- 
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