Common data structures

Common data structures used by aiohttp internally.

FrozenList

A list-like structure which implements collections.abc.MutableSequence.

The list is mutable unless FrozenList.freeze() is called, after that the list modification raises RuntimeError.

class aiohttp.FrozenList(items)

Construct a new non-frozen list from items iterable.

The list implements all collections.abc.MutableSequence methods plus two additional APIs.

frozen

A read-only property, True is the list is frozen (modifications are forbidden).

freeze()

Freeze the list. There is no way to thaw it back.

ChainMapProxy

An immutable version of collections.ChainMap. Internally the proxy is a list of mappings (dictionaries), if the requested key is not present in the first mapping the second is looked up and so on.

The class supports collections.abc.Mapping interface.

class aiohttp.ChainMapProxy(maps)

Create a new chained mapping proxy from a list of mappings (maps).

New in version 3.2.