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

Method __and__

numpy/array_api/_array_object.py:445–454  ·  view source on GitHub ↗

Performs the operation __and__.

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

Source from the content-addressed store, hash-verified

443 return self.__class__._new(res)
444
445 def __and__(self: Array, other: Union[int, bool, Array], /) -> Array:
446 """
447 Performs the operation __and__.
448 """
449 other = self._check_allowed_dtypes(other, "integer or boolean", "__and__")
450 if other is NotImplemented:
451 return other
452 self, other = self._normalize_two_args(self, other)
453 res = self._array.__and__(other._array)
454 return self.__class__._new(res)
455
456 def __array_namespace__(
457 self: Array, /, *, api_version: Optional[str] = None

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