-
-
Couldn't load subscription status.
- Fork 33.3k
gh-129545 Improve Syntax Error Message for Default Parameter Order #130937
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
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
note: will add news entry tmw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @sharktide! I'm good with this change. I've left one comment about a formatting issue.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One editorial comment on the news blurb. Also, a better category for it would be Core and Builtins. Maybe move it there?
Misc/NEWS.d/next/C_API/2025-03-07-16-48-12.gh-issue-129545.t-9iTH.rst
Outdated
Show resolved
Hide resolved
…iTH.rst Co-authored-by: Lysandros Nikolaou <[email protected]>
ok |
|
@lysnikolaou I moved the news entry to Core and Builtins as well as took your change suggestion |
|
Sorry to bother you, but could you please re-review this pull request? TiA |
|
@lysnikolaou Could you please check this PR again? It has been over a month I have been waiting. |
|
@lysnikolaou Please Review this PR. It has been 2mo |
|
@pablogsal What do you think about this wording change? |
|
I am not convinced is yielding a lot of extra clarity but maybe I am biased here so I am happy taking this in if you want. I am +0 |
|
@lysnikolaou pablogsal left his input. Please decide to merge or not |
|
Thanks @sharktide for all the reminders! After discussing this with more folks, I'm gonna side with @pablogsal and say that this doesn't really provide too much more clarity, so I'll close the PR. Thanks a lot for your patience. I'd be happy to review another one if you wanna work on another part of the parser. |
Fixes and closes #129545
Overview:
The
SyntaxError: parameter without a default follows parameter with a defaulterror message has been modified toSyntaxError: positional parameter without a default follows parameter with a defaultto clarify error messages.As mentioned in #129545
@smheidrich
As also mentioned by @smheidrich:
The new error message, should be accurate for most cases and should not be confusing. However, if there are cases where the original error message might be more appropriate ex when dealing with keyword-only parameters or other specific syntax rules but the new change would cause minimal confusion compared to the problem that this pr intends to solve.
SyntaxError: parameter without a default follows parameter with a defaultis inaccurate #129545