Commit d9f9232
authored
bpo-44636: Collapse union of equal types (pythonGH-27178)
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.1 parent aeaa553 commit d9f9232
3 files changed
Lines changed: 23 additions & 9 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Core and Builtins
- Objects
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
| 626 | + | |
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| 654 | + | |
| 655 | + | |
654 | 656 | | |
655 | 657 | | |
656 | 658 | | |
| |||
704 | 706 | | |
705 | 707 | | |
706 | 708 | | |
| 709 | + | |
| 710 | + | |
707 | 711 | | |
708 | 712 | | |
709 | 713 | | |
| |||
721 | 725 | | |
722 | 726 | | |
723 | 727 | | |
| 728 | + | |
724 | 729 | | |
725 | 730 | | |
726 | 731 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
554 | 565 | | |
555 | 566 | | |
| 567 | + | |
556 | 568 | | |
557 | 569 | | |
558 | 570 | | |
559 | 571 | | |
560 | | - | |
| 572 | + | |
561 | 573 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | 574 | | |
567 | 575 | | |
0 commit comments