gh-104799: Default missing lists in AST to the empty list (#104834)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Jelle Zijlstra 2023-06-01 18:39:39 -07:00 committed by GitHub
parent 37498fc950
commit 77d2579586
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 400 additions and 239 deletions

View file

@ -1591,6 +1591,8 @@ class ASTValidatorTests(unittest.TestCase):
f = ast.FunctionDef("x", a, [ast.Pass()], [],
ast.Name("x", ast.Store()), None, [])
self.stmt(f, "must have Load context")
f = ast.FunctionDef("x", ast.arguments(), [ast.Pass()])
self.stmt(f)
def fac(args):
return ast.FunctionDef("x", args, [ast.Pass()], [], None, None, [])
self._check_arguments(fac, self.stmt)