ValueKey¶
- class dsviper.ValueKey¶
Bases:
ValueA value of type key<element_type>. Use the static factory method create(…).
Note: Not directly instantiable.
- static cast(value: Value | _OutputValues) ValueKey¶
Return value as a key, or raise if it is not one.
- static create(type_concept: TypeConcept, instance_id: str | ValueUUId | None = None) ValueKey¶
Return a key naming an instance of type_concept - instance_id, or a fresh uuid when it is None.
- description(*, namespace: NameSpace | None = None) str¶
Return the value written out, then its type, as <value>:<type>.
namespace qualifies the type name; representation() gives the value alone.
- detail_representation() str¶
Return the representation, with the concept name spelled out.
- detail_type_representation() str¶
Return the key’s type, naming the concept of its instance.
‘key<Concept>’ for a key typed by its own concept; when the key is typed by a club, by any_concept or by a parent concept, that type followed by the concept in parentheses: ‘key<Club>(Concept)’. The instance uuid is not part of it.
- has_parent_key() bool¶
Return True if a parent key is available.
- hash() int¶
Return the hash value.
- is_member(target_concept: TypeConcept) bool¶
Return True if target_concept is a member.
- static keys(key: ValueKey) list[ValueKey]¶
Return key and every key above it, from the instance up to its root concept.
- representation() str¶
Return the value written out: the instance uuid.
- to_club_key(type_club: TypeClub) ValueKey¶
Return value as a key<type_club>, or raise if it is not one.
- to_member_key(target_concept: TypeConcept) ValueKey¶
Return value as a key<target_concept>, or raise if it is not one.
- type_code() str¶
Return the code naming this kind of value, such as “int32”, “struct” or “vector”.
- type_concept() TypeConcept¶
Return the type of the concept.