New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change directive default to `language_level=3` #2565

Open
scoder opened this Issue Aug 18, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@scoder
Contributor

scoder commented Aug 18, 2018

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.

@scoder scoder added this to the 3.0 milestone Aug 18, 2018

@jdemeyer

This comment has been minimized.

Show comment
Hide comment
@jdemeyer

jdemeyer Aug 21, 2018

Contributor

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).

Contributor

jdemeyer commented 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

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Sep 16, 2018

Contributor

I agree that unicode_literals is a special case that is worth excluding. I updated the ticket description.

Contributor

scoder commented Sep 16, 2018

I agree that unicode_literals is a special case that is worth excluding. I updated the ticket description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment