mypy
mypy copied to clipboard
stubgen generates bad signatures when mixing historical positional-only names and keyword-only parameters
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.