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] Union is not defined #13779

Closed
matejsp opened this issue Sep 30, 2022 · 1 comment
Closed

[stubgen] Union is not defined #13779

matejsp opened this issue Sep 30, 2022 · 1 comment
Labels
bug mypy got something wrong topic-stubgen

Comments

@matejsp
Copy link

matejsp commented Sep 30, 2022

Another stubgen issue

Stubgen for following code:

def get_country_code(country_code):
    # type: (str) -> str | None

generated:

def get_country_code(country_code: str) -> Union[str, None]: ...

But Union is not defined as import.

Your Environment

  • Mypy version used: v0.981
  • Mypy command-line flags: /
  • Mypy configuration options from mypy.ini (and other config files): /
  • Python version used: 3.8.13
@matejsp matejsp added the bug mypy got something wrong label Sep 30, 2022
@hauntsaninja
Copy link
Collaborator

Duplicate of #12929

@hauntsaninja hauntsaninja marked this as a duplicate of #12929 Sep 30, 2022
@hauntsaninja hauntsaninja closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-stubgen
Projects
None yet
Development

No branches or pull requests

3 participants