Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-44636: Collapse union of equal types#27178

Merged
serhiy-storchaka merged 1 commit into
python:mainpython/cpython:mainfrom
serhiy-storchaka:union-singleserhiy-storchaka/cpython:union-singleCopy head branch name to clipboard
Jul 16, 2021
Merged

bpo-44636: Collapse union of equal types#27178
serhiy-storchaka merged 1 commit into
python:mainpython/cpython:mainfrom
serhiy-storchaka:union-singleserhiy-storchaka/cpython:union-singleCopy head branch name to clipboard

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 16, 2021

Copy link
Copy Markdown
Member

The result of int | int is now int.

Fix comparison of the union type with non-hashable objects.
int | str == {} no longer raises a TypeError.

https://bugs.python.org/issue44636

The result of `int | int` is now `int`.

Fix comparison of the union type with non-hashable objects.
`int | str == {}` no longer raises a TypeError.

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome. Thanks!

@serhiy-storchaka serhiy-storchaka merged commit d9f9232 into python:main Jul 16, 2021
@miss-islington

Copy link
Copy Markdown
Contributor

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

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker d9f923280f204204f8703756aef4f655b579b4b8 3.10

@serhiy-storchaka serhiy-storchaka deleted the union-single branch July 16, 2021 09:49
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jul 16, 2021
The result of `int | int` is now `int`.

Fix comparison of the union type with non-hashable objects.
`int | str == {}` no longer raises a TypeError..
(cherry picked from commit d9f9232)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-27181 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jul 16, 2021
serhiy-storchaka added a commit that referenced this pull request Jul 16, 2021
The result of `int | int` is now `int`.

Fix comparison of the union type with non-hashable objects.
`int | str == {}` no longer raises a TypeError.
(cherry picked from commit d9f9232)
@serhiy-storchaka serhiy-storchaka removed their assignment Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.