On this page
typing.ChainMap
Prev: typing.cast | Up: typing | Next: typing.ClassVar
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.ChainMap
Tags: #public #python3 #stdlib #typing
Import
import typing
from typing import ChainMap
Signature & Overview
typing.ChainMap(*args, **kwargs)
Deprecated alias to collections.ChainMap.
Usage
from collections import ChainMap as _CM
from typing import ChainMap
cfg: ChainMap[str, int] = _CM({"a": 1}, {"b": 2})
assert cfg["b"] == 2
Gotchas
- Deprecated alias in Python 3.9+: Use
collections.ChainMap[str, int]directly.
REPL Inspect
from typing import ChainMap
help(ChainMap)
Linked from
Related notes
- tuts/python3/stdlib_module/typing/cast Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/ClassVar 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