On Fri, Oct 24, 2008 at 2:30 AM, Aaron DeVore <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 23, 2008 at 3:08 AM, Stefan Behnel <[EMAIL PROTECTED]> wrote:
> I just took a peek at the source in cython-dev. I don't really
> understand what's happening in the file but Builtin.py seems to have
> some support for the set type.

What's happens is that some support was recently added ;-)

>>> As a side note, how about making an adjustment to Cython that
>>> automatically handles the set type/sets module trick?

Somewhat hard. In Py2.3, sets.Set is Python (i.e. implemented in pure
Python) class, and in Py>2.4 it is an extension (i.e. C-implemented)
class. But perhaps Cython could generate a thin C proxy class for
sets.Set.

>
> or this
> try:
> ----set
> except NameError:
> ----from sets import Set as set

This should work, as long as you use Python 2.3 for runing Cython and
for compliling the generated sources.

> It seems like there could be an issue with static typing using the
> imported Python class sets.Set (e.g. `cdef set foo`). I don't know
> enough about Cython to make a good guess on that one.

And yes, in Python 2.3 you will not be able to do 'cdef set foo'.



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