TypeClub

class dsviper.TypeClub

Bases: Type

A club type: a named list of concepts, so that one key type can address an instance of any of them.

Definitions.create_club makes one and create_membership adds a concept to it; a key of the club holds a key of one of its members.

Note: Not directly instantiable.

static cast(type: Type) → TypeClub

Return type as a TypeClub, or raise if it is not one.

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

Return the same as representation(): the declared name, qualified against namespace.

documentation() → str

Return the documentation the club was created with, empty when none was given.

is_member(type_concept: TypeConcept) → bool

Return True if type_concept is one of members().

A concept that specialises a member is not one: membership is the list create_membership builds, and parent() is not followed. TypeConcept.is_member asks another question, whether the receiver specialises the argument.

members() → list[TypeConcept]

Return the list of concepts.

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

Return the name the type was declared under, 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”.

type_name() → TypeName

Return the TypeName: the namespace and the name the type was declared under.