]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.10] bpo-44636: Collapse union of equal types (GH-27178) (GH-27181)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 16 Jul 2021 11:48:20 +0000 (14:48 +0300)
committerGitHub <noreply@github.com>
Fri, 16 Jul 2021 11:48:20 +0000 (14:48 +0300)
commitc3007ab3c6cb384203bac8aa64d89c4b42f671a1
treec0829b008569a28ec516b6e13820aaed7210e6c8
parent37686f78ccef5f1cf4776419a4270cf0ea7eadf0
[3.10] bpo-44636: Collapse union of equal types (GH-27178) (GH-27181)

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 d9f923280f204204f8703756aef4f655b579b4b8)
Lib/test/test_types.py
Misc/NEWS.d/next/Core and Builtins/2021-07-16-09-36-12.bpo-44636.ZWebi8.rst [new file with mode: 0644]
Objects/unionobject.c