[Pyrex] [Cython] ANN: Pyrex 0.9.9

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Apr 13 09:50:22 CEST 2010


Stefan Behnel wrote:
> +1 for the feature, -1 for the syntax. Python 3 has keyword arguments in 
> the baseclass tuple, so this would be much better here:
> 
>      cdef class Spam(gc=False):
>          cdef object sausage

I'm in two minds about this. In Python, those keyword arguments are
actual expressions that are evaluated at run time and passed to the
type's __init__ method. Options to Pyrex extension types only have
meaning at compile time, and they're all special in different ways.
To me they have quite a different flavour.

> It would become a little funny if "intern(char*)" worked in Py3 but 
> "intern(bytes)" didn't, so I'm reluctant to enabling support for char* in 
> Py3.

If Cython is able to generate different code for an intern() call
depending on what type of argument it's passed, then that's fine.
Pyrex only needed the name change because its builtin function
handling isn't that smart, and I'd rather not spend a lot of effort
on changing it just to handle rare cases like this.

-- 
Greg



More information about the Pyrex mailing list