diff options
author | Shantanu <12621235+hauntsaninja@users.noreply.github.com> | 2022-08-12 18:41:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 18:41:02 (GMT) |
commit | a965db37f27ffb232312bc13d9a509f0d93fcd20 (patch) | |
tree | bf7580bafffed26950a1d9ba5b5982b6b7e78d75 /Lib/test/test_ast.py | |
parent | b5e3ea286289fcad12be78480daf3756e350f69f (diff) | |
download | cpython-a965db37f27ffb232312bc13d9a509f0d93fcd20.zip cpython-a965db37f27ffb232312bc13d9a509f0d93fcd20.tar.gz cpython-a965db37f27ffb232312bc13d9a509f0d93fcd20.tar.bz2 |
gh-94996: Disallow lambda pos only params with feature_version < (3, 8) (GH-95934)
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r-- | Lib/test/test_ast.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 2f3e9d5..4cfefe4 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -746,6 +746,13 @@ class AST_Tests(unittest.TestCase): with self.assertRaises(SyntaxError): ast.parse('def bar(x=1, /): ...', feature_version=(3, 7)) + ast.parse('lambda x, /: ...', feature_version=(3, 8)) + ast.parse('lambda x=1, /: ...', feature_version=(3, 8)) + with self.assertRaises(SyntaxError): + ast.parse('lambda x, /: ...', feature_version=(3, 7)) + with self.assertRaises(SyntaxError): + ast.parse('lambda x=1, /: ...', feature_version=(3, 7)) + def test_parenthesized_with_feature_version(self): ast.parse('with (CtxManager() as example): ...', feature_version=(3, 10)) # While advertised as a feature in Python 3.10, this was allowed starting 3.9 |