Mojo trait
Identifiable
The Identifiable trait denotes a type with an identity which can be compared with other instances of itself.
Implemented traits
AnyType,
UnknownDestructibility
Aliases
__del__is_trivial
alias __del__is_trivial
A flag (often compiler generated) to indicate whether the implementation of __del__ is trivial.
The implementation of __del__ is considered to be trivial if:
- The struct has a compiler-generated trivial destructor and all its fields
have a trivial
__del__method.
In practice, it means that the __del__ can be considered as no-op.
Required methods
__is__
__is__(self: _Self, rhs: _Self) -> Bool
Define whether self has the same identity as rhs.
Args:
- rhs (
_Self): The right hand side of the comparison.
Returns:
Bool: True if self is rhs.
Provided methods
__isnot__
__isnot__(self: _Self, rhs: _Self) -> Bool
Define whether self has a different identity than rhs.
Args:
- rhs (
_Self): The right hand side of the comparison.
Returns:
Bool: True if self is not rhs.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!