ndtools.comparison.operators module#
- eq(left: T, right: Any, /) T[source]#
Implement the
==operator for multidimensional arrays.If
leftdoes not implement the__eq__method, it will fall back to an equivalent implementation using another comparison operators.- Parameters:
left (T) – Left hand side of the operator.
right (Any) – Right hand side of the operator.
- Returns:
Result of
left == right.- Raises:
AttributeError – Raised if no comparison operator is defined for
left == right.- Return type:
T
- ge(left: T, right: Any, /) T[source]#
Implement the
>=operator for multidimensional arrays.If
leftdoes not implement the__ge__method, it will fall back to an equivalent implementation using another comparison operators.- Parameters:
left (T) – Left hand side of the operator.
right (Any) – Right hand side of the operator.
- Returns:
Result of
left >= right.- Raises:
AttributeError – Raised if no comparison operator is defined for
left >= right.- Return type:
T
- gt(left: T, right: Any, /) T[source]#
Implement the
>operator for multidimensional arrays.If
leftdoes not implement the__gt__method, it will fall back to an equivalent implementation using another comparison operators.- Parameters:
left (T) – Left hand side of the operator.
right (Any) – Right hand side of the operator.
- Returns:
Result of
left > right.- Raises:
AttributeError – Raised if no comparison operator is defined for
left > right.- Return type:
T
- le(left: T, right: Any, /) T[source]#
Implement the
<=operator for multidimensional arrays.If
leftdoes not implement the__le__method, it will fall back to an equivalent implementation using another comparison operators.- Parameters:
left (T) – Left hand side of the operator.
right (Any) – Right hand side of the operator.
- Returns:
Result of
left <= right.- Raises:
AttributeError – Raised if no comparison operator is defined for
left <= right.- Return type:
T
- lt(left: T, right: Any, /) T[source]#
Implement the
<operator for multidimensional arrays.If
leftdoes not implement the__lt__method, it will fall back to an equivalent implementation using another comparison operators.- Parameters:
left (T) – Left hand side of the operator.
right (Any) – Right hand side of the operator.
- Returns:
Result of
left < right.- Raises:
AttributeError – Raised if no comparison operator is defined for
left < right.- Return type:
T
- ne(left: T, right: Any, /) T[source]#
Implement the
!=operator for multidimensional arrays.If
leftdoes not implement the__ne__method, it will fall back to an equivalent implementation using another comparison operators.- Parameters:
left (T) – Left hand side of the operator.
right (Any) – Right hand side of the operator.
- Returns:
Result of
left != right.- Raises:
AttributeError – Raised if no comparison operator is defined for
left != right.- Return type:
T