internal.types.rtti

Standard library module View source
function force_cast
@inline
force_cast(obj, D: type)
class TypeInfo
class TypeInfo
Fields 20
id int
n_mro int
mro Ptr[int]
offsets Ptr[int]
sorted_mro Ptr[int]
n_slots int
slots Ptr[Tuple[str, int, int]]
n_methods int
methods Ptr[_MethodSlot]
rtti bool
raw_name str
nice_name str
base_name str
n_params int
params Ptr[int]
size int
reference bool
inline_value bool
exception_offset int
system_exit_offset int
Methods 6
value_hash
value_hash(self, data: Ptr[byte])

Hash an erased payload using this descriptor's registered adapter.

value_equal
value_equal(self, left: Ptr[byte], right: Ptr[byte])

Compare two erased payloads of this descriptor's type.

value_dict
value_dict(self, data: Ptr[byte])

Copy an erased dictionary through its typed items iterator.

cache
cache(id: int)
cache(T: type)
is_parent
is_parent(self, T: type)
wrap
wrap(arg: Ptr[u8], T: type)
Special methods 6
__raw__
__raw__(self)
__iter__
__iter__(self)
__str__
__str__(self)
__repr__
__repr__(self)
__eq__
__eq__(self, other: TypeInfo)
__ne__
__ne__(self, other: TypeInfo)
function get_typeinfo
@pure @llvm
get_typeinfo(obj)
%info = load ptr, ptr %obj
ret ptr %info
class Super
@extend
class Super[T]
Constructors 1
__new__
__new__(B: type, obj: D, D: type)
Special methods 1
__getattr__
__getattr__(self, attr: Literal[str])