What’s the difference between JSON vs Python Dict?

  • JSON keys must be a string but Python dicts can have any immutable type
  • JSON is a wire transfer format, whereas dicts are in-memory data structure
  • JSON is language-agnostic, universal representation whereas dicts are built-in data type of Python
  • JSON as the name suggests is a notation, a rule to represent data in a text file, whereas dicts under the hood is an object with keys and values that are objects