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

PEP 617: Fix expression typo in rationale #3244

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

isnbh0
Copy link
Contributor

@isnbh0 isnbh0 commented Aug 2, 2023

In the rationale section, the expression for the intended rule for assignment expressions has brackets around the wrong part, making the logic hard to follow.

For reference, here's an excerpt of Guido's post which was likely the source for the section:

The first case is that of assignment expressions. The Grammar says:

namedexpr_test: test [':=' test]

but what we really want to say is:

namedexpr_test: [NAME ':='] test

Unfortunately that’s not LL(1) since NAME is also in the FIRST set of test. (You can think of test as the pre-PEP-572 top-level expression rule, named test for historical reasons.)


📚 Documentation preview 📚: https://pep-previews--3244.org.readthedocs.build/

@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Aug 2, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@Rosuav
Copy link
Contributor

Rosuav commented Aug 2, 2023

I think you're right. Given that this line has been in the PEP unchanged since it was created, and since the post it's almost directly a quote from has it differently, I would agree that this is a typo. Can anyone with an old copy of the CPython grammar confirm that the rule definitely was as per Guido's post and not as per the text in this PEP?

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Yeah, that's right. Very sharp eyes, John!

Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

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

Can anyone with an old copy of the CPython grammar confirm that the rule definitely was as per Guido's post and not as per the text in this PEP?

No. It's the rule we wanted but couldn't have due to LL(1) limitations, so it never appeared in Grammar.

@pablogsal pablogsal merged commit de468db into python:main Aug 2, 2023
4 checks passed
@pablogsal
Copy link
Member

Thanks for the contribution @isnbh0 !

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.

5 participants