Skip to content
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

--py311-plus should not unquote annotations #637

Closed
JelleZijlstra opened this issue May 4, 2022 · 4 comments · Fixed by #638
Closed

--py311-plus should not unquote annotations #637

JelleZijlstra opened this issue May 4, 2022 · 4 comments · Fixed by #638

Comments

@JelleZijlstra
Copy link
Contributor

https://github.com/asottile/pyupgrade#remove-quoted-annotations says that --py311-plus will remove quoted annotations. I suppose that was done under the assumption that PEP 563 (from __future__ import annotations) would become the default in 3.11, but that's not happening. (And probably not in the future either.)

@JelleZijlstra
Copy link
Contributor Author

Happy to contribute a PR for this if you agree.

@asottile
Copy link
Owner

asottile commented May 4, 2022

ah yes, that was supposed to be cleaned up with the other revert but looks like it got missed:

state.settings.min_version >= (3, 11) or

JelleZijlstra added a commit to JelleZijlstra/pyupgrade that referenced this issue May 4, 2022
`from __future__ import annotations` will not be the default
behavior on 3.11.

Fixes asottile#637.
@Molkree
Copy link

Molkree commented May 9, 2022

PEP 563 (from __future__ import annotations) would become the default in 3.11, but that's not happening

@JelleZijlstra, where can I read about this? Doc for __future__ still mentions 3.11.

@JelleZijlstra
Copy link
Contributor Author

PEP 563 (from __future__ import annotations) would become the default in 3.11, but that's not happening

@JelleZijlstra, where can I read about this? Doc for __future__ still mentions 3.11.

Right, I filed an issue for that too :) python/cpython#92436

https://mail.python.org/archives/list/python-dev@python.org/message/VIZEBX5EYMSYIJNDBF6DMUMZOCWHARSO/ is the announcement for delaying it from 3.11.

My sense (based on discussions at PyCon) is that we'll end up with some form of PEP 649 behavior in 3.12, but that's not yet decided.

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

Successfully merging a pull request may close this issue.

3 participants