The overall codebase used in this example is smelly.
The overall codebase used in this example is smelly.
What keys does the dictionary "person_data" have? Well, originally it only contained username and email address, later we added street address (everywhere where it was used, we think). And then came preferred language, but that was only added in the functions that care about that. And so on, and so forth...
Eventually all functions work with a slightly different version of a person_data dict, you're never quite sure which one a given function expects, and there is no central definition. Death by duck typing.
Dicts are for algorithms, they shouldn't be the go-to tool for structs of data. That's what classes and namedtuples are for.
Shortcomings are that it's not in stdlib and does have a few quirks (for example, be sure to convert a Dict to a dict with .to_dict() before json'ing). However, it's a nice and well maintained module.