summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index ae10669..69a8623 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -334,7 +334,12 @@ From ast_for_arguments():
>>> def f(x, y=1, z):
... pass
Traceback (most recent call last):
-SyntaxError: non-default argument follows default argument
+SyntaxError: parameter without a default follows parameter with a default
+
+>>> def f(x, /, y=1, z):
+... pass
+Traceback (most recent call last):
+SyntaxError: parameter without a default follows parameter with a default
>>> def f(x, None):
... pass
@@ -555,6 +560,14 @@ SyntaxError: expected default value expression
Traceback (most recent call last):
SyntaxError: expected default value expression
+>>> lambda a,d=3,c: None
+Traceback (most recent call last):
+SyntaxError: parameter without a default follows parameter with a default
+
+>>> lambda a,/,d=3,c: None
+Traceback (most recent call last):
+SyntaxError: parameter without a default follows parameter with a default
+
>>> import ast; ast.parse('''
... def f(
... *, # type: int