[Cython] Should we start requiring "language_level=2" for .pyx files?

Stefan Behnel stefan_ml at behnel.de
Mon May 28 14:56:03 EDT 2018


Hi,

Python 3 is clearly taking over the world these days, so it starts feeling
arcane to require Py2 syntax in .pyx files. Increasingly, it means that
people cannot just rename .py files anymore to start optimising them,
because the .py file has a high chance of being written in Py3 syntax.

Eventually, we will have to switch to Py3 syntax by default in order to
follow what most people are (or will be) used to.

As a transition, I think we could start warning about cases where the
language level is not set explicitly. If people start marking their code as
being "Cython 2.x code", either with an in-file directive or from their
setup.py, we will have less of a problem in the future to change the default.

What do you think? Any other ideas, comments, objections?

Stefan


More information about the cython-devel mailing list