TypeKey

class dsviper.TypeKey(element_type)

Bases: Type

The key<element_type> type.

element_type() is a concept, a club or any_concept - is_concept(), is_club() and is_any_concept() say which; ValueKey builds values of it.

Where a container’s element_type is what it holds, a key’s is what it refers to: a key holds an instance id, never the concept itself.

static cast(type: Type) → TypeKey

Return the type key<element_type> or raise.

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

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

element_type() → Type

Return the abstraction the key names: a concept, a club or any_concept.

is_concept(), is_club() and is_any_concept() say which.

is_any_concept() → bool

Return True if element_type is any_concept.

is_club() → bool

Return True if element_type is a club.

is_concept() → bool

Return True if element_type is a concept.

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

Return the type written out as key<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”.