]> granicus.if.org Git - python/commit
bpo-29622: Make AST constructor to accept less than enough number of positional argum...
authorINADA Naoki <methane@users.noreply.github.com>
Thu, 23 Feb 2017 17:48:17 +0000 (02:48 +0900)
committerGitHub <noreply@github.com>
Thu, 23 Feb 2017 17:48:17 +0000 (02:48 +0900)
commit4c78c527d215c37472145152cb0e95f196cdddc9
treed35b832dec5db996f48e1ef9c40ae987c9fd1855
parent561ca80cffd37445bac82ff820b8f52b98c50517
bpo-29622: Make AST constructor to accept less than enough number of positional arguments (GH-249)

bpo-29463 added optional "docstring" field to 4 AST types.
While it is optional, it breaks backward compatibility because AST constructor
requires number of positional argument is same to number of fields.

AST types accepts empty arguments, and incomplete keyword arguments.
But it's not big problem because field can be filled after creation, and checked when compiling.
So stop requiring complete set of fields for positional arguments too.
Lib/test/test_ast.py
Parser/asdl_c.py
Python/Python-ast.c