Skip to content

bpo-40147: Move the check for duplicate keywords to the compiler #19289

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 2 commits into from
Apr 3, 2020

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Apr 2, 2020

@pablogsal
Copy link
Member Author

As a bonus now we print the actual keyword that is repeated.

Before:

❯ python lel.py                       
  File "lel.py", line 1
    f(1, x=2, *(3, 4), x=5)
                       ^
SyntaxError: keyword argument repeated

After:

❯ ./python lel.py  
  File "/home/pablogsal/github/python/master/lel.py", line 1
    f(1, x=2, *(3, 4), x=5)
                       ^
SyntaxError: keyword argument repeated: x

@pablogsal
Copy link
Member Author

CC: @lysnikolaou

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.

Nice! That was simpler than I expected.

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

Successfully merging this pull request may close these issues.

5 participants