Skip to content

bpo-40614: Respect feature version for f-string debug expressions #20196

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

Merged
merged 7 commits into from
May 27, 2020

Conversation

hauntsaninja
Copy link
Contributor

@hauntsaninja hauntsaninja commented May 18, 2020

@lysnikolaou
Copy link
Member

@pablogsal If this is okay, I guess we should also change the old parser to do this and backport that to 3.8 as well?

@pablogsal
Copy link
Member

I guess we should also change the old parser to do this and backport that to 3.8 as well?

Yeah, but the backport should be done manually to not include the parts for the new parser.

Comment on lines +935 to +936
RAISE_SYNTAX_ERROR("f-string: self documenting expressions are "
"only supported in Python 3.8 and greater");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to ignore this. (Note that if you don't the message should be changed in the old parser as well)

Suggested change
RAISE_SYNTAX_ERROR("f-string: self documenting expressions are "
"only supported in Python 3.8 and greater");
RAISE_SYNTAX_ERROR("Self-documenting expressions in f-strings are "
"only supported in Python 3.8 and greater");

Copy link
Contributor Author

@hauntsaninja hauntsaninja May 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! All the other f-string SyntaxErrors start with "f-string: ", so I think it's good to stay consistent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, didn't remember correctly then.

hauntsaninja and others added 2 commits May 18, 2020 17:23
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
@hauntsaninja
Copy link
Contributor Author

Happy to open a PR with a manual backport using cherry_picker if this gets merged!

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hauntsaninja
Copy link
Contributor Author

Should that label be "needs backport to 3.8"?

@lysnikolaou
Copy link
Member

lysnikolaou commented May 19, 2020

Nope, master is 3.10 as of about 3 hours ago. This needs to be backported to 3.9 as-is and then the change to the old parser should also be manually backported to 3.8.

@lysnikolaou lysnikolaou requested review from pablogsal and removed request for pablogsal May 24, 2020 10:16
@pablogsal pablogsal merged commit c116c94 into python:master May 27, 2020
@miss-islington
Copy link
Contributor

Thanks @hauntsaninja for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @hauntsaninja and @pablogsal, I had trouble checking out the 3.9 backport branch.
Please backport using cherry_picker on command line.
cherry_picker c116c94ff119485761460f1033cdee425bed0310 3.9

@hauntsaninja hauntsaninja deleted the fstringeq branch May 27, 2020 20:30
pablogsal pushed a commit to pablogsal/cpython that referenced this pull request May 27, 2020
…ns (pythonGH-20196)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
@bedevere-bot
Copy link

GH-20464 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label May 27, 2020
hauntsaninja added a commit to hauntsaninja/cpython that referenced this pull request May 27, 2020
…thonGH-20196)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94)
@hauntsaninja
Copy link
Contributor Author

Opened a backport to 3.8 in #20466

pablogsal added a commit that referenced this pull request May 27, 2020
…ns (GH-20196) (GH-20464)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
pablogsal added a commit that referenced this pull request Jun 6, 2020
…-20196) (GH-20466)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants