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

Method __invert__

numpy/array_api/_array_object.py:596–603  ·  view source on GitHub ↗

Performs the operation __invert__.

(self: Array, /)

Source from the content-addressed store, hash-verified

594 return res
595
596 def __invert__(self: Array, /) -> Array:
597 """
598 Performs the operation __invert__.
599 """
600 if self.dtype not in _integer_or_boolean_dtypes:
601 raise TypeError("Only integer or boolean dtypes are allowed in __invert__")
602 res = self._array.__invert__()
603 return self.__class__._new(res)
604
605 def __le__(self: Array, other: Union[int, float, Array], /) -> Array:
606 """

Callers

nothing calls this directly

Calls 1

_newMethod · 0.80

Tested by

no test coverage detected