Haoyu Bai, 22.03.2010 17:39: > Your suggestion about Python 3 support > also lead to an interesting idea. That is, to make use of the Python 3 > function annotation syntax to have a more convenient pure Python mode > in Cython. > > For example, this: > > cdef str foo(int x): > ... > > could be written as: > > def foo(x:int) -> str: > ... > > or maybe more verbose: > > def foo(x:cython.int) -> cython.str: > ... > > This could make the pure Python mode more easier and attractive.
Note that I already added support for this syntax to the parser. All that's missing is the recognition of the annotations as type declarations, should be doable in a day or so, given that most of this is implemented in the pure Python mode anyway. > There's also some minor improvement regarding Python 3 support could > be done in Cython. Such as support for "nonlocal" keyword Take a look at the Py3 related tickets in our bug tracker. > and float > division "1/2" (which evaluated as 0.5 in Python 3 but 0 in Cython). IIRC, there's a future import for this. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
