[Cython] CEP 507/513

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Fri Apr 18 10:37:53 CEST 2008


> I don't like the idea of requiring @cython.typed everywhere, way too  
> verbose. The "x: T" notation will have the disadvantage that if T is  
> not interpretable as a type, it will just ignore it (maybe with a  
> warning in strict mode or something).
This is a whole different discussion, but just wanted to note an idea I 
had: For "cdef" functions, one could drop the decorator and only allow 
types (raising syntax errors otherwise -- runtime introspection won't be 
available to read the decorators anyway, so that's the only usecase).

On "def" functions I'd go for decorator though, as a means of sanely 
compiling Python 3 code that is not written with Cython in mind at all.

Also, I'm going a little back on the orthogonality: Within the "x: T" 
syntax one might want to think seriously about not allowing some of the 
type C syntax, ie require importing type names (without spaces) from 
cython.types and so on. Otherwise, compiling pure Python 3 code with "x: 
int" (if we find we can  treat it as a Cython type declaration) will 
have problems as well.

-- 
Dag Sverre



More information about the Cython-dev mailing list