On Thu, Jun 24, 2010 at 12:09 PM, Dag Sverre Seljebotn
<[email protected]> wrote:
> Cython files are called .pyx files for historical reasons: For a long
> time Cython was simply smaller patches on top of Pyrex. This is not
> longer true. I don't believe we would honestly recommend to anyone that
> they maintain codebases that should be buildable on both compilers.
> (That it is easy to convert a Pyrex project to a Cython project is
> another story.)
>
> While the .pyx extension will obviously stick with us for many years to
> come, I'm proposing that we add support for a .cy extension as well, and
> change the documentation to use this. They'll be completely
> interchangeable, almost nothing in the Cython codebase should know the
> difference (and I imagine that Sage and lxml would stick to pyx for a
> long time).

+1 (FWIW).  This would definitely make things easier working with
distutils  since it assumes '.pyx' means Pyrex, as you mention.

Would .pxd map to .cyd?  .pxi -> .cyi?

As an internal issue, not that important: would it be preferable to
change the name-mangling prefix from '__pyx' to '__cy'?  Since
annotations (or whatever the '-a' option gives you) make the generated
code visible to the end user, this might help give a sense of overall
project consistency.

>
> This is simply to be a good citizen. Build systems rely on extensions to
> invoke the proper tool, and it would then be possible for SCons, waf,
> CMake etc. to include default builders for both Cython and Pyrex without
> any conflicts (if you want to use such tools, you simply use the .cy
> extension -- if you already use .pyx you obviously already have a build
> system set up for that). It would even be possible to mix Cython and
> Pyrex in the same project (e.g. with distutils...). Not that that is a
> likely situation, but it seems less arrogant with respect to Pyrex to
> use our own suffix rather than patching away Pyrex support in the build
> tools.
>
> (setuptools already hardwires .pyx to Pyrex, for instance).
>
> --
> Dag Sverre
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to