Skip to content

Support get_origin(Union[...]) in python 3.14#119

Merged
ilevkivskyi merged 2 commits into
ilevkivskyi:masterfrom
leon-sony:py314-union-origin
Jan 18, 2026
Merged

Support get_origin(Union[...]) in python 3.14#119
ilevkivskyi merged 2 commits into
ilevkivskyi:masterfrom
leon-sony:py314-union-origin

Conversation

@leon-sony

Copy link
Copy Markdown
Contributor

In Python 3.14, Union is no longer a typingGenericAlias, so get_origin(int | str) didn't return Union. This changes that by explicitly checking for is_union_type. This adds a test for get_origin(Union[...]).

leon-sony and others added 2 commits January 16, 2026 17:20
In Python 3.14, `Union` is no longer a `typingGenericAlias`, so
`get_origin(int | str)` didn't return `Union`. This changes that by
explicitly checking for `is_union_type`. This adds a test for
`get_origin(Union[...])`.

@ilevkivskyi ilevkivskyi left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LG, thanks!

@ilevkivskyi ilevkivskyi merged commit ce24e24 into ilevkivskyi:master Jan 18, 2026
9 checks passed
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.

2 participants