On Aug 19, 2008, at 7:53 AM, Stefan Behnel wrote:

> Andrew Straw wrote:
>> Hi, looking at the Cython Sphinx documentation, I don't see the  
>> Python
>> version as a variable I can use for conditional compilation. This  
>> would
>> be handy in the case of newly added features in the Python-C API, for
>> example. Would this be feasible to add (alongside UNAME_SYSNAME and
>> friends)?
>
> Feasible, yes, but it doesn't make much sense to check the Python  
> version
> at Cython compile time. The C code that gets generated by Cython  
> will run
> on all Python versions from 2.3 to 3.0, and on all major platforms.  
> You
> will loose that if you start generating platform-specific C code  
> for the
> system that happens to run Cython on your code.

If you want to do this I would recommend putting them in an actual .h  
file (with a cdef extern import block) so that the resulting .c files  
could be used on multiple Python versions.

Out of curiosity, what of the Python/C API do you need? (I'd rather  
to fix Cython to not have to directly call it.)

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to