| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| | '*' 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") } |
There was a problem hiding this comment.
I liked @picnixz suggestion though there may be an even better word?
Sorry, something went wrong.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| | '*' 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") } |
There was a problem hiding this comment.
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.
|
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. |
Sorry, something went wrong.
|
I'll close this one and the corresponding issue. We'll work with one issue and one PR instead. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.