Commit 5478cd3
committed
docs: document why json_dumps requires sorted keys for cache hashing
Add comprehensive docstring to json_dumps() explaining that key sorting
is critical for deterministic JSON output, which is used to compute
cache hashes in incremental type checking. Without sorted keys,
dictionaries with the same content but different key insertion order
would produce different hashes, causing incorrect cache invalidation.
This addresses the TODO comment and clarifies the relationship between
JSON serialization and the caching system.1 parent eabda0e commit 5478cd3
1 file changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
925 | 925 | | |
926 | 926 | | |
927 | 927 | | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
928 | 941 | | |
929 | 942 | | |
930 | 943 | | |
931 | 944 | | |
932 | | - | |
933 | | - | |
934 | 945 | | |
935 | 946 | | |
936 | 947 | | |
| |||
942 | 953 | | |
943 | 954 | | |
944 | 955 | | |
945 | | - | |
946 | 956 | | |
947 | 957 | | |
948 | 958 | | |
| |||
0 commit comments