Skip to main content

trait

Testable

A trait that a struct should conform to if we do equality testing on it.

Implemented traits

AnyType, EqualityComparable, Stringable

Methods

__eq__

__eq__(self: T, other: T) -> Bool

Define whether two instances of the object are equal to each other.

Args:

  • other (T): Another instance of the same type.

Returns:

True if the instances are equal according to the type's definition of equality, False otherwise.

__ne__

__ne__(self: T, other: T) -> Bool

Define whether two instances of the object are not equal to each other.

Args:

  • other (T): Another instance of the same type.

Returns:

True if the instances are not equal according to the type's definition of equality, False otherwise.

__str__

__str__(self: T) -> String

Get the string representation of the type.

Returns:

The string representation of the type.