Repository navigation
Commit 544bf89
committed
gh-159184: Do not compare set elements when marshalling a set
Set elements are written in the order of their dumps. They were sorted
as (dump, element) pairs, so elements with the same dump were compared.
That raised TypeError for a set of several complex NaNs, which the
compiler can produce by constant folding, making the module impossible
to marshal.
Sort (dump, index, element) tuples, in which the indexes are all
different. Elements with the same dump stay in the order of the set,
as float NaNs did before.1 parent 7893950 commit 544bf89
3 files changed
Lines changed: 63 additions & 18 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Python
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
607 | 607 | | |
608 | | - | |
609 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
610 | 641 | | |
611 | 642 | | |
612 | 643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
848 | | - | |
849 | | - | |
850 | | - | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
851 | 855 | | |
852 | 856 | | |
853 | 857 | | |
| |||
871 | 875 | | |
872 | 876 | | |
873 | 877 | | |
874 | | - | |
875 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
876 | 887 | | |
877 | 888 | | |
878 | 889 | | |
879 | | - | |
| 890 | + | |
880 | 891 | | |
881 | 892 | | |
882 | 893 | | |
| |||
885 | 896 | | |
886 | 897 | | |
887 | 898 | | |
888 | | - | |
| 899 | + | |
889 | 900 | | |
890 | 901 | | |
891 | | - | |
| 902 | + | |
892 | 903 | | |
893 | | - | |
| 904 | + | |
894 | 905 | | |
895 | 906 | | |
896 | 907 | | |
897 | | - | |
898 | | - | |
| 908 | + | |
| 909 | + | |
899 | 910 | | |
900 | 911 | | |
901 | | - | |
| 912 | + | |
902 | 913 | | |
903 | 914 | | |
904 | 915 | | |
| |||
0 commit comments