TypeMap

class dsviper.TypeMap(key_type, element_type)

Bases: Type

The map<key_type, element_type> type.

key_type() and element_type() are the two Types it pairs; ValueMap builds values of it.

static cast(type: Type) → TypeMap

Return the type map<key_type, element_type> or raise.

description(*, namespace: NameSpace | None = None) → str

Return the same as representation(): map<key_type, element_type>, qualified against namespace.

element_type() → Type

Return the type of the values the map holds - key_type() gives the keys.

item_type() → TypeTuple

Return tuple<key_type, element_type>, the type of one entry.

items_type() → TypeVector

Return vector<item_type>, the type a whole entry listing has.

key_type() → Type

Return the type of the keys the map is indexed by.

keys_type() → TypeSet

Return set<key_type>, the type a whole key listing has.

representation(*, namespace: NameSpace | None = None) → str

Return the type written out as map<key_type, element_type>, with the names qualified against namespace - the global namespace when it is None.

runtime_id() → ValueUUId

Return the uuid identifying this type.

It is computed from what the type is, so the same declaration yields the same id in any Definitions. Definitions says what each kind is computed from.

type_code() → str

Return the code naming this kind of type, such as “int32”, “struct” or “vector”.

values_type() → TypeVector

Return vector<element_type>, the type a whole value listing has.