-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
pyrepl always has from __future__ import annotations
on
#119443
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
topic-repl
Related to the interactive shell
type-bug
An unexpected behavior, bug, or error
Comments
JelleZijlstra
added
type-bug
An unexpected behavior, bug, or error
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
topic-repl
Related to the interactive shell
labels
May 22, 2024
JelleZijlstra
added a commit
to JelleZijlstra/cpython
that referenced
this issue
May 24, 2024
There's a related issue where it is impossible to turn a future import on in the REPL, because every line is compiled separately, and the future imports from the previous one are forgotten when the next one runs. |
JelleZijlstra
added a commit
to JelleZijlstra/cpython
that referenced
this issue
May 24, 2024
JelleZijlstra
added a commit
that referenced
this issue
May 29, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 29, 2024
…ythonGH-119493) (cherry picked from commit a8e35e8) Co-authored-by: Jelle Zijlstra <[email protected]>
JelleZijlstra
added a commit
that referenced
this issue
May 29, 2024
…GH-119493) (#119697) gh-119443: Turn off from __future__ import annotations in REPL (GH-119493) (cherry picked from commit a8e35e8) Co-authored-by: Jelle Zijlstra <[email protected]>
noahbkim
pushed a commit
to hudson-trading/cpython
that referenced
this issue
Jul 11, 2024
estyxx
pushed a commit
to estyxx/cpython
that referenced
this issue
Jul 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
topic-repl
Related to the interactive shell
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
This likely happens because the code is exec()'ed in a file that has the future import; exec() inherits the
__future__
state from the file where it's called (a questionable feature but that's how it is).For what it's worth, PEP 649 explicitly says the REPL should continue to use "stock" semantics: https://peps.python.org/pep-0649/#interactive-repl-shell.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Tasks
Linked PRs
The text was updated successfully, but these errors were encountered: