Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-133436: Correct error messages that incorrectly use "arguments"#133463

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@StanFromIreland
Copy link
Member

@StanFromIrelandStanFromIreland commentedMay 5, 2025
edited by bedevere-appbot
Loading

| '*' 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") }
Copy link
MemberAuthor

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?

Copy link

@KivooeoKivooeoMay 5, 2025
edited
Loading

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

lysnikolaou reacted with thumbs up emoji

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 withbare *. So I think that it is better to use just* here.

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a 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

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a 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

| '*' 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") }

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 withbare *. So I think that it is better to use just* here.

@picnixz
Copy link
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)

@serhiy-storchaka
Copy link
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

@picnixz
Copy link
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

@picnixzpicnixz closed thisMay 9, 2025
@StanFromIrelandStanFromIreland deleted the marker-err branchMay 9, 2025 15:03
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

+1 more reviewer

@KivooeoKivooeoKivooeo left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@StanFromIreland@picnixz@serhiy-storchaka@Kivooeo

[8]ページ先頭

©2009-2025 Movatter.jp