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

gh-88834: Unify the instance check for typing.Union and types.UnionType #128363

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 30, 2024

Union now uses the instance checks against its parameters instead of the subclass checks.

…nionType

Union now uses the instance checks against its parameters instead of
the subclass checks.
@serhiy-storchaka serhiy-storchaka merged commit b2ac70a into python:main Dec 31, 2024
48 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the typing-union-isinstance branch December 31, 2024 08:03
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 31, 2024
…nionType (pythonGH-128363)

Union now uses the instance checks against its parameters instead of
the subclass checks.
(cherry picked from commit b2ac70a62ad1be8e037ce45ccf5f1b753ea5e64b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 31, 2024
…nionType (pythonGH-128363)

Union now uses the instance checks against its parameters instead of
the subclass checks.
(cherry picked from commit b2ac70a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Dec 31, 2024

GH-128370 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Dec 31, 2024
@bedevere-app
Copy link

bedevere-app bot commented Dec 31, 2024

GH-128371 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Dec 31, 2024
serhiy-storchaka added a commit that referenced this pull request Dec 31, 2024
…UnionType (GH-128363) (GH-128371)

Union now uses the instance checks against its parameters instead of
the subclass checks.
(cherry picked from commit b2ac70a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Dec 31, 2024
…UnionType (GH-128363) (GH-128370)

Union now uses the instance checks against its parameters instead of
the subclass checks.
(cherry picked from commit b2ac70a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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