TypedDicts are better than you think

TypedDict was introduced in PEP-589 which landed in Python 3.8. The primary use case was to create type annotations for dictionaries. For example, class Movie ( TypedDict ): title : str movie : Movie = { "title" : "Avatar" } I remember thinking at the time that this was pretty neat, but I tend to use dataclass …