TypeConcept

class dsviper.TypeConcept

Bases: Type

A concept type.

Note: Not directly instantiable.

static cast(type: Type) → TypeConcept

Return type as a TypeConcept, 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 concept was created with, empty when none was given.

is_member(type_concept: TypeConcept) → bool

Return True if this concept is type_concept or specialises it.

Following parent() upwards from this concept reaches type_concept. The receiver is the member here; TypeClub.is_member asks the reverse, whether the argument is one of the club’s members.

parent() → TypeConcept | None

Return the parent concept or None.

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.