gh-129545 Improve Syntax Error Message for Default Parameter Order#130937
gh-129545 Improve Syntax Error Message for Default Parameter Order#130937sharktide wants to merge 9 commits into
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 |
lysnikolaou
left a comment
There was a problem hiding this comment.
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 |
lysnikolaou
left a comment
There was a problem hiding this comment.
One editorial comment on the news blurb. Also, a better category for it would be Core and Builtins. Maybe move it there?
…iTH.rst Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
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