Skip to content

stubgen generates bad signatures when mixing historical positional-only names and keyword-only parameters #19315

Open
@brianschubert

Description

@brianschubert

Bug Report

Given:

def f1(*, __kw): pass
def f2(x, /, *, __kw): pass

stubgen generates:

def f1(*, /, __kw) -> None: ...     # invalid syntax
def f2(x, *, /, __kw) -> None: ...  # invalid syntax

This sort of signature seems to be permitted by the typing spec based on this conformance test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions