Skip to content

Commit

Permalink
docs: add a note for typing_extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
PrettyWood committed Jan 11, 2021
1 parent 7b45015 commit 7368bf9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/usage/types.md
Expand Up @@ -408,12 +408,21 @@ _(This script is complete, it should run "as is")_
## Annotated Types

### NamedTuple

```py
{!.tmp_examples/annotated_types_named_tuple.py!}
```
_(This script is complete, it should run "as is")_

### TypedDict

!!! note
This is a new feature of the python standard library as of python 3.8.
Prior to python 3.8, it requires the [typing-extensions](https://pypi.org/project/typing-extensions/) package.
But required and optional fields are properly differentiated only since python 3.9.
It is hence recommanded using [typing-extensions](https://pypi.org/project/typing-extensions/) with python 3.8 as well.


```py
{!.tmp_examples/annotated_types_typed_dict.py!}
```
Expand Down

0 comments on commit 7368bf9

Please sign in to comment.