Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubgen moves non default keyword-only argument in front of * #11082

Closed
khameeteman opened this issue Sep 9, 2021 · 0 comments · Fixed by #12303
Closed

Stubgen moves non default keyword-only argument in front of * #11082

khameeteman opened this issue Sep 9, 2021 · 0 comments · Fixed by #12303
Labels

Comments

@khameeteman
Copy link

Bug Report

Stubgen generates incorre stubs when a non default keyword-only argument is positioned after the asterix symbol in the signature.

To Reproduce

  1. Create a function:
def func(*, non_default_kwarg: bool, default_kwarg: bool = True):
    pass
  1. Generate stubs

Expected Behavior

def func(*, non_default_kwarg: bool, default_kwarg: bool=...) -> Any: ...

Actual Behavior

def func(non_default_kwarg: bool, *, default_kwarg: bool=...) -> Any: ...

Your Environment

  • Mypy version used: 0.812
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants