MCPcopy Create free account
hub / github.com/numpy/numpy / __eq__

Method __eq__

numpy/array_api/_array_object.py:496–507  ·  view source on GitHub ↗

Performs the operation __eq__.

(self: Array, other: Union[int, float, bool, Array], /)

Source from the content-addressed store, hash-verified

494 return self._array.__dlpack_device__()
495
496 def __eq__(self: Array, other: Union[int, float, bool, Array], /) -> Array:
497 """
498 Performs the operation __eq__.
499 """
500 # Even though "all" dtypes are allowed, we still require them to be
501 # promotable with each other.
502 other = self._check_allowed_dtypes(other, "all", "__eq__")
503 if other is NotImplemented:
504 return other
505 self, other = self._normalize_two_args(self, other)
506 res = self._array.__eq__(other._array)
507 return self.__class__._new(res)
508
509 def __float__(self: Array, /) -> float:
510 """

Callers

nothing calls this directly

Calls 3

_check_allowed_dtypesMethod · 0.95
_normalize_two_argsMethod · 0.95
_newMethod · 0.80

Tested by

no test coverage detected