mirror of
https://github.com/python/cpython.git
synced 2025-09-24 01:13:22 +00:00
gh-133379: Fix misuse of the term "arguments" in error messages (GH-133382)
The right term is "parameters".
This commit is contained in:
parent
f28cbc9fd3
commit
dbca27cfca
10 changed files with 72 additions and 68 deletions
|
@ -419,7 +419,7 @@ SyntaxError: invalid syntax
|
|||
>>> def foo(/,a,b=,c):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: at least one argument must precede /
|
||||
SyntaxError: at least one parameter must precede /
|
||||
|
||||
>>> def foo(a,/,/,b,c):
|
||||
... pass
|
||||
|
@ -454,67 +454,67 @@ SyntaxError: / must be ahead of *
|
|||
>>> def foo(a,*b=3,c):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: var-positional argument cannot have default value
|
||||
SyntaxError: var-positional parameter cannot have default value
|
||||
|
||||
>>> def foo(a,*b: int=,c):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: var-positional argument cannot have default value
|
||||
SyntaxError: var-positional parameter cannot have default value
|
||||
|
||||
>>> def foo(a,**b=3):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: var-keyword argument cannot have default value
|
||||
SyntaxError: var-keyword parameter cannot have default value
|
||||
|
||||
>>> def foo(a,**b: int=3):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: var-keyword argument cannot have default value
|
||||
SyntaxError: var-keyword parameter cannot have default value
|
||||
|
||||
>>> def foo(a,*a, b, **c, d):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> def foo(a,*a, b, **c, d=4):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> def foo(a,*a, b, **c, *d):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> def foo(a,*a, b, **c, **d):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> def foo(a=1,/,**b,/,c):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> def foo(*b,*d):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: * argument may appear only once
|
||||
SyntaxError: * may appear only once
|
||||
|
||||
>>> def foo(a,*b,c,*d,*e,c):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: * argument may appear only once
|
||||
SyntaxError: * may appear only once
|
||||
|
||||
>>> def foo(a,b,/,c,*b,c,*d,*e,c):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: * argument may appear only once
|
||||
SyntaxError: * may appear only once
|
||||
|
||||
>>> def foo(a,b,/,c,*b,c,*d,**e):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: * argument may appear only once
|
||||
SyntaxError: * may appear only once
|
||||
|
||||
>>> def foo(a=1,/*,b,c):
|
||||
... pass
|
||||
|
@ -538,7 +538,7 @@ SyntaxError: expected default value expression
|
|||
|
||||
>>> lambda /,a,b,c: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: at least one argument must precede /
|
||||
SyntaxError: at least one parameter must precede /
|
||||
|
||||
>>> lambda a,/,/,b,c: None
|
||||
Traceback (most recent call last):
|
||||
|
@ -570,47 +570,47 @@ SyntaxError: expected comma between / and *
|
|||
|
||||
>>> lambda a,*b=3,c: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: var-positional argument cannot have default value
|
||||
SyntaxError: var-positional parameter cannot have default value
|
||||
|
||||
>>> lambda a,**b=3: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: var-keyword argument cannot have default value
|
||||
SyntaxError: var-keyword parameter cannot have default value
|
||||
|
||||
>>> lambda a, *a, b, **c, d: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> lambda a,*a, b, **c, d=4: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> lambda a,*a, b, **c, *d: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> lambda a,*a, b, **c, **d: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> lambda a=1,/,**b,/,c: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: arguments cannot follow var-keyword argument
|
||||
SyntaxError: parameters cannot follow var-keyword parameter
|
||||
|
||||
>>> lambda *b,*d: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: * argument may appear only once
|
||||
SyntaxError: * may appear only once
|
||||
|
||||
>>> lambda a,*b,c,*d,*e,c: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: * argument may appear only once
|
||||
SyntaxError: * may appear only once
|
||||
|
||||
>>> lambda a,b,/,c,*b,c,*d,*e,c: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: * argument may appear only once
|
||||
SyntaxError: * may appear only once
|
||||
|
||||
>>> lambda a,b,/,c,*b,c,*d,**e: None
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: * argument may appear only once
|
||||
SyntaxError: * may appear only once
|
||||
|
||||
>>> lambda a=1,d=,c: None
|
||||
Traceback (most recent call last):
|
||||
|
@ -1304,7 +1304,7 @@ Missing parens after function definition
|
|||
Traceback (most recent call last):
|
||||
SyntaxError: expected '('
|
||||
|
||||
Parenthesized arguments in function definitions
|
||||
Parenthesized parameters in function definitions
|
||||
|
||||
>>> def f(x, (y, z), w):
|
||||
... pass
|
||||
|
@ -2178,7 +2178,7 @@ Corner-cases that used to fail to raise the correct error:
|
|||
|
||||
>>> with (lambda *:0): pass
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: named arguments must follow bare *
|
||||
SyntaxError: named parameters must follow bare *
|
||||
|
||||
Corner-cases that used to crash:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue