Skip to main content
Log in

Mojo trait

Identifiable

The Identifiable trait denotes a type with an identity which can be compared with other instances of itself.

Implemented traits​

AnyType

Methods​

__is__​

__is__(self: T, rhs: T) -> Bool

Define whether self has the same identity as rhs.

Args:

  • ​rhs (T): The right hand side of the comparison.

Returns:

True if self is rhs.

__isnot__​

__isnot__(self: T, rhs: T) -> Bool

Define whether self has a different identity than rhs.

Args:

  • ​rhs (T): The right hand side of the comparison.

Returns:

True if self is not rhs.

Was this page helpful?