[issue16545] ast.FunctionDef sets a bad value for kw_defaults when keyword-only arguments present

2012-11-26 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea resolution: invalid - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16545 ___

[issue16545] ast.FunctionDef sets a bad value for kw_defaults when keyword-only arguments present

2012-11-26 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16545 ___

[issue16545] ast.FunctionDef sets a bad value for kw_defaults when keyword-only arguments present

2012-11-24 Thread Daniel Urban
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +daniel.urban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16545 ___ ___

[issue16545] ast.FunctionDef sets a bad value for kw_defaults when keyword-only arguments present

2012-11-24 Thread Daniel Urban
Daniel Urban added the comment: If I understand correctly, the invariant is that len(kw_defaults) == len(kwonlyargs). I think the reason is that the following is valid syntax (an argument without a default after one with a default): def f(*, a=0, b): pass ... And None is used as a

[issue16545] ast.FunctionDef sets a bad value for kw_defaults when keyword-only arguments present

2012-11-24 Thread Brett Cannon
Brett Cannon added the comment: Ah, I see it now. I didn't realize that we allowed people to define keyword-only arguments in any order they wanted in terms of default values, allowing interleaving of default and non-default values. So this is correct, just different from everything else.

[issue16545] ast.FunctionDef sets a bad value for kw_defaults when keyword-only arguments present

2012-11-23 Thread Brett Cannon
New submission from Brett Cannon: When there are no keyword-only arguments, the value of kw_defaults for FunctionDef is []. But when keyword-only arguments are present with no default values, it becomes [None]. That's bad as every other value in FunctionDef has a default of [] when there is