diff --git a/cheatsheets/python/type-checks/data-structures/dictionary.md b/cheatsheets/python/type-checks/data-structures/dictionary.md index f9c925b15..9971d14f9 100644 --- a/cheatsheets/python/type-checks/data-structures/dictionary.md +++ b/cheatsheets/python/type-checks/data-structures/dictionary.md @@ -17,7 +17,7 @@ So you can validate that a dictionary passed around meets the following: - Fields are only null when allowed to be. -## Using plain Dict +## Use a plain dict Here we create a type using a dictionary. @@ -99,6 +99,18 @@ Here are using a `Movie` type, defined as follows: Movie = TypedDict('Movie', {'name': str, 'year': int}) ``` +A nested example: + +```python +FooBar = TypedDict( + "FooBar", + { + "Id": str, + "Status": TypedDict("Status", {"Id": int, "Name": str}), + }, +) +``` + The 4 approaches are: #### Annotation