📝 Update Python Types docs, add missing 3.6 / 3.9 example (#4434)

This commit is contained in:
Sebastián Ramírez 2022-01-16 15:44:08 +01:00 committed by GitHub
parent b8ae84d460
commit 7fe79441c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -252,7 +252,7 @@ The second type parameter is for the values of the `dict`:
=== "Python 3.9 and above" === "Python 3.9 and above"
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial008.py!} {!> ../../../docs_src/python_types/tutorial008_py39.py!}
``` ```
This means: This means:

View File

@ -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(): for item_name, item_price in prices.items():
print(item_name) print(item_name)
print(item_price) print(item_price)

View File

@ -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)