concepts.dsl.dsl_types.ObjectType#
- class ObjectType[source]#
Bases:
TypeBase
The ObjectType corresponds to the type of “real-world” objects.
Methods
Return the value type for assignment.
downcast_compatible
(other[, ...])Check if the type is downcast-compatible with the other type; that is, if this type is a subtype of the other type.
Iterate over all parent types.
long_str
()Return the long string representation of the type.
set_parent_type
(parent_type)Return the short string representation of the type.
Attributes
An optional alias of the type.
Return the typename of the base type.
Return whether the type is a multidimensional list type.
Return whether the type is a list type.
Return whether the type is an object type.
Return whether the type is a Python object value type.
Return whether the type is a sequence type.
Return whether the type is a tensor value type.
Return whether the type is a tuple type.
Return whether the type is a value type.
The parent type of the type.
Return the typename of the parent type.
The (full) typename of the type.
The parent types of the object type.
- __init__(typename, parent_types=None, alias=None)[source]#
Initialize the object type.
- Parameters:
typename (str) – The name of the object type.
alias (str | None) – The alias of the object type.
parent_types (Sequence[ObjectType] | None)
- __new__(**kwargs)#
- downcast_compatible(other, allow_self_list=False, allow_list=False)#
Check if the type is downcast-compatible with the other type; that is, if this type is a subtype of the other type.
- iter_parent_types()[source]#
Iterate over all parent types.
- Yields:
the parent types following the inheritance order.
- Return type:
- property base_typename#
Return the typename of the base type.
- property is_object_type#
Return whether the type is an object type.
- property parent_typename#
Return the typename of the parent type.
- parent_types: Tuple[ObjectType, ...]#
The parent types of the object type.