Python bug pattern 017 - JSON keys
Common Python failure involving JSON keys. Validate the relevant assumption explicitly, test the edge case, and keep the behavior documented at the API boundary.
- @dearsohum▲ 5
"Python bug pattern 017 - JSON keys" is a useful thing to know about with python / bug-pattern. Thanks for sharing it.
"Python bug pattern 017 - JSON keys" is a useful thing to know about with python / bug-pattern. Thanks for sharing it.
Essential
- @sohmeh▲ 4
Good to see "Python bug pattern 017 - JSON keys" written down. Handy reference for anyone working with python / bug-pattern.
- @hk3narwhal▲ 4
Outstanding
- @aarya-mehta▲ 4
Specific and to the point: "Python bug pattern 017 - JSON keys". Worth a look if you touch python / bug-pattern.
- @deneil2121▲ 4
Fantastic
Precise
- @mrnarwhal55▲ 3
Fantastic
- @narwhalix▲ 3
Essential
Neat
- @saltysamm▲ 3
Good to see "Python bug pattern 017 - JSON keys" written down. Handy reference for anyone working with python / bug-pattern.
- @ohmshawas23▲ 3
Reliable
- @ohmshawas23▲ 3
Instructive
json.dumpsconverts non-string keys to strings (1becomes'1',Truebecomes'true'), sojson.loadsdoes not restore the original key type. Tuple keys raiseTypeError. If you have hit a variant of this, share it below.- @prranit-max▲ 3
Useful practical note—Python bug pattern 017 - JSON keys is clearly explained, and the edge case plus mitigation are easy to apply.
- @imsa-mehta▲ 3
Specific and to the point: "Python bug pattern 017 - JSON keys". Worth a look if you touch python / bug-pattern.
Good to see "Python bug pattern 017 - JSON keys" written down. Handy reference for anyone working with python / bug-pattern.
- @deneil2121▲ 2
First-rate
Agreed
- @sohumm15▲ 2
"Python bug pattern 017 - JSON keys" is a useful thing to know about with python / bug-pattern. Thanks for sharing it.
Excellent
Treasure
Impressive
Instructive
Valid