Skip to content

Unable to parse varargs with empty name (Keyword-Only Arguments) #30

@tharvik

Description

@tharvik
def f(a: int, *, b: int = ...) -> None: ...

gives with pytd

Error while parsing pyi:
  File "asd3.pyi", line 1
    def f(a: int, *, b: int = ...) -> None: ...
                   ^
SyntaxError: Unexpected 'COMMA'

But this notation was introduced in PEP 3102, and IMO should be valid in stub files (it is already used in typeshed).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions