Skip to content

Commit

Permalink
馃摑 Update Python Types docs, add missing 3.6 / 3.9 example (#4434)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Jan 16, 2022
1 parent b8ae84d commit 7fe7944
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/en/docs/python-types.md
Expand Up @@ -252,7 +252,7 @@ The second type parameter is for the values of the `dict`:
=== "Python 3.9 and above"

```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial008.py!}
{!> ../../../docs_src/python_types/tutorial008_py39.py!}
```

This means:
Expand Down
5 changes: 4 additions & 1 deletion docs_src/python_types/tutorial008.py
@@ -1,4 +1,7 @@
def process_items(prices: dict[str, float]):
from typing import Dict


def process_items(prices: Dict[str, float]):
for item_name, item_price in prices.items():
print(item_name)
print(item_price)
4 changes: 4 additions & 0 deletions docs_src/python_types/tutorial008_py39.py
@@ -0,0 +1,4 @@
def process_items(prices: dict[str, float]):
for item_name, item_price in prices.items():
print(item_name)
print(item_price)

0 comments on commit 7fe7944

Please sign in to comment.