You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change directive default to language_level=3 #2565
This is a breaking change that needs preparation. It changes the default semantics of the Cython language from Python 2 to Python 3.
Specifically, it will enable the __future__ imports division, print_function, absolute_import, and preferably also generator_stop (which became active in Python 3.7).
Excluding unicode_literals from the default setup seems like a good idea, as long as users want to continue supporting Python 2.x (and if they don't then it makes no difference for Py 3.x anyway). In this case, it is worth considering if f-strings should also be supported for Py2 str, although it might not be worth implementing this given the nearing end of life of Py2.
Users will be able to opt out of this by explicitly setting language_level=2. We should emit a warning in a prior release when no language level is specified.
Activity
jdemeyer commentedon Aug 21, 2018
As I mentioned on the mailing list, I would very much like to exclude
from __future__ import unicode_literals(which is often considered a bad idea).scoder commentedon Sep 16, 2018
I agree that
unicode_literalsis a special case that is worth excluding. I updated the ticket description.Add a new directive 'str_is_str=True' that keeps unprefixed string li…
Remove the new 'str_is_str' directive again and replace it by a new "…
fish2000 commentedon Nov 29, 2018
Before this goes into effect, can someone address #2661 – in which setting
language_level=3breakscimportstatements that work fine under level 2?