Issue 37112: Error in compilig the AST for functions with optional positional-only arguments (original) (raw)

import ast sample = 'def f(a=1, /): pass' compile(sample, '?', 'exec') <code object at 0x7f7cacdfd5c0, file "?", line 1> compile(ast.parse(sample, '?'), '?', 'exec') Traceback (most recent call last): File "", line 1, in ValueError: more positional defaults than args on arguments