class type_param_demo.Derived[U](type_param_demo.Map[int, U])[source]

Map from integer keys to arbitrary values.

Type Parameters:
U

Mapped value type.

Constructors

Derived()[source]
Derived(items: Mapping[int, U])
Derived(items: Iterable[tuple[int, U]])

Construct from the specified items.

Public members

clear()[source]

Clear the map.

keys(-> KeysView[int][source]

Return a dynamic view of the keys.

items(-> ItemsView[int, U][source]

Return a dynamic view of the items.

values(-> ValuesView[U][source]

Return a dynamic view of the values.

get(key: int-> U | None[source]
get(key: intdefault: U-> U
get[T](key: intdefault: T-> U | T

Return the mapped value, or the specified default.

__len__(-> int[source]

Return the number of items in the map.

__contains__(key: int-> bool[source]

Check if the map contains key.

__getitem__(key: int-> U[source]

Return the value associated with key.

__setitem__(key: intvalue: U)[source]

Set the value associated with the specified key.

__delitem__(key: int)[source]

Remove the value associated with the specified key.

__iter__(-> Iterator[int][source]

Iterate over the keys.


Last update: Nov 16, 2024