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] Preserve PEP 604 Unions in generated pyi files #14601

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

hamdanal
Copy link
Collaborator

@hamdanal hamdanal commented Feb 3, 2023

When a PEP 604 Union exists in the runtime, stubgen was generating a Union[...] syntax without importing Union from typing. With this change, stubgen preserves the |-unions in the output.

Fixes #12929
Closes #13428
Ref #12920

When a PEP 604 Union exists in the runtime, stubgen was generating a
`Union[...]` syntax without importing `Union` from `typing`. With this
change, stubgen preserves the ` | `-unions in the output.

Fixes python#12929
Closes python#13428
Ref python#12920
Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@hauntsaninja hauntsaninja merged commit 725214b into python:master Feb 7, 2023
@hamdanal hamdanal deleted the stubgen-union branch February 10, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stubgen: import Union if generated stub code includes
2 participants