On this page
typing.Dict
Prev: typing.Deque | Up: typing | Next: typing.evaluate_forward_ref
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.Dict
Tags: #public #python3 #stdlib #typing
Import
import typing
from typing import Dict
Signature & Overview
typing.Dict(*args, **kwargs)
Deprecated alias to dict.
Usage
from typing import Dict
scores: Dict[str, int] = {"ada": 100}
assert scores["ada"] == 100
Gotchas
- Deprecated alias in Python 3.9+: Use built-in
dict[str, int]directly.
REPL Inspect
from typing import Dict
help(Dict)
Linked from
Related notes
- tuts/python3/stdlib_module/typing/Deque Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/evaluate_forward_ref Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/typing/AbstractSet Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Annotated Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Any Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/assert_never Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/assert_type shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/AsyncContextManager shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/AsyncGenerator shared tags: #stdlib, #typing