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

Method __truediv__

numpy/array_api/_array_object.py:768–777  ·  view source on GitHub ↗

Performs the operation __truediv__.

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

Source from the content-addressed store, hash-verified

766 # PEP 484 requires int to be a subtype of float, but __truediv__ should
767 # not accept int.
768 def __truediv__(self: Array, other: Union[float, Array], /) -> Array:
769 """
770 Performs the operation __truediv__.
771 """
772 other = self._check_allowed_dtypes(other, "floating-point", "__truediv__")
773 if other is NotImplemented:
774 return other
775 self, other = self._normalize_two_args(self, other)
776 res = self._array.__truediv__(other._array)
777 return self.__class__._new(res)
778
779 def __xor__(self: Array, other: Union[int, bool, Array], /) -> Array:
780 """

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