RustPython / Parser

MIT License
77 stars 29 forks source link

Parser incompatibility with "def woohoo(a, *, b): pass" #43

Open youknowone opened 1 year ago

youknowone commented 1 year ago
>>> ast.dump(ast.parse("def woohoo(a, *, b): pass"))
"Module(body=[FunctionDef(name='woohoo', args=arguments(posonlyargs=[], args=[arg(arg='a')], kwonlyargs=[arg(arg='b')], kw_defaults=[None], defaults=[]), body=[Pass()], decorator_list=[])], type_ignores=[])"
>>> ast.dump(rustpython_parse("def woohoo(a, *, b): pass"))
"Module(body=[FunctionDef(name='woohoo', args=arguments(posonlyargs=[], args=[arg(arg='a')], kwonlyargs=[arg(arg='b')], kw_defaults=[], defaults=[]), body=[Pass()], decorator_list=[])], type_ignores=[])"

kw_defaults=[None] vs kw_defaults=[]