[New-bugs-announce] [issue37112] Error in compilig the AST for functions with optional positional arguments

Serhiy Storchaka report at bugs.python.org
Fri May 31 07:31:31 EDT 2019


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

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

----------
components: Interpreter Core
messages: 344064
nosy: benjamin.peterson, brett.cannon, pablogsal, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Error in compilig the AST for functions with optional positional arguments
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37112>
_______________________________________


More information about the New-bugs-announce mailing list