go-python / go-python/gpython

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

Offen
#89 4 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @corona10 Auf GitHub ansehen
bug Contributhon2019
Vorherrschende Sprache
Go
Sterne
1k
Forks
105
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

But accepted in gpython
it should be raised Syntax error.

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

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.