GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-133436: Correct error messages that incorrectly use "arguments" by StanFromIreland · Pull Request #133463 · python/cpython

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented May 5, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: * parameter's error messages say argument instead of parameter #133436

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StanFromIreland
Add
19197bf
@StanFromIreland
StanFromIreland requested review from lysnikolaou and pablogsal as code owners May 5, 2025 18:38
@bedevere-app bedevere-app Bot mentioned this pull request May 5, 2025
* parameter's error messages say argument instead of parameter #133436
Closed
@bedevere-app bedevere-app Bot added the awaiting review label May 5, 2025
StanFromIreland
StanFromIreland commented May 5, 2025
View reviewed changes
Comment thread Grammar/python.gram
| '*' param a='=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "var-positional argument cannot have default value") }
| '*' (param_no_default | ',') param_maybe_default* a='*' (param_no_default | ',') {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "* argument may appear only once") }
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "* marker may appear only once") }

@StanFromIreland StanFromIreland May 5, 2025

Copy link
Copy Markdown
Member Author

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.

I liked @picnixz suggestion though there may be an even better word?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Kivooeo Kivooeo May 5, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

imo, "an asterisk may appear only once" is as clear as possible and will not cause any confusion in terms of terminology

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lysnikolaou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@serhiy-storchaka serhiy-storchaka May 9, 2025

Copy link
Copy Markdown
Member

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.

Other error messages refer to / as just / and to * as just *. On other hand, * marker can be confused with bare *. So I think that it is better to use just * here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StanFromIreland
!fixup Add
3e009f0
serhiy-storchaka
serhiy-storchaka reviewed May 9, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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.

There are more:

    def f(/, *a, b): pass
          ^
SyntaxError: at least one argument must precede /
    def f(**a, b): pass
               ^
SyntaxError: arguments cannot follow var-keyword argument

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
serhiy-storchaka
serhiy-storchaka reviewed May 9, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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.

More examples:

    def f(/, a, /, b): pass
          ^
SyntaxError: at least one argument must precede /
    def f(a, a): pass
             ^
SyntaxError: duplicate argument 'a' in function definition

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Grammar/python.gram
| '*' param a='=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "var-positional argument cannot have default value") }
| '*' (param_no_default | ',') param_maybe_default* a='*' (param_no_default | ',') {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "* argument may appear only once") }
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "* marker may appear only once") }

@serhiy-storchaka serhiy-storchaka May 9, 2025

Copy link
Copy Markdown
Member

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.

Other error messages refer to / as just / and to * as just *. On other hand, * marker can be confused with bare *. So I think that it is better to use just * here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@picnixz

picnixz commented May 9, 2025

Copy link
Copy Markdown
Member

The rest is in #133382, but maybe we can do all in one PR? I suggested two because of semantics, but maybe it's better to do everything at once (in this case, let's use #133382 instead and close the other issue as well)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka serhiy-storchaka mentioned this pull request May 9, 2025
gh-133379: Correct usage of arguments in error messages #133382
Merged
@serhiy-storchaka

serhiy-storchaka commented May 9, 2025

Copy link
Copy Markdown
Member

I suggest to do all in one PR. I do not see semantic difference. There are other error messages that need corrections, see my examples.

picnixz and lysnikolaou reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented May 9, 2025

Copy link
Copy Markdown
Member

I'll close this one and the corresponding issue. We'll work with one issue and one PR instead.

StanFromIreland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz picnixz closed this May 9, 2025
@StanFromIreland
StanFromIreland deleted the marker-err branch May 9, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka left review comments
@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal is a code owner
@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou is a code owner
+1 more reviewer
@Kivooeo Kivooeo Kivooeo left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@StanFromIreland @picnixz @serhiy-storchaka @Kivooeo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.