On this page
  1. typing.Dict
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from typing import Dict
help(Dict)

Linked from

Related notes