Skip to content

def a(x=3, b, c) should not be accepted #89

Open
@corona10

Description

@corona10

But accepted in gpython
it should be raised Syntax error.

cpython

>>> def a(x=3, b, c):
...     pass
...
  File "<stdin>", line 1
SyntaxError: non-default argument follows default argument

gpython

>>> def a(x=3, b, c):
...     pass
...
>>> a()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
TypeError: "a() missing 2 required positional arguments: 'x' and 'b'"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions