mirror of https://github.com/tiangolo/fastapi.git
📝 Update Python Types docs, add missing 3.6 / 3.9 example (#4434)
This commit is contained in:
parent
b8ae84d460
commit
7fe79441c1
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
Loading…
Reference in New Issue