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

Method __add__

numpy/array_api/_array_object.py:434–443  ·  view source on GitHub ↗

Performs the operation __add__.

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

Source from the content-addressed store, hash-verified

432 return self.__class__._new(res)
433
434 def __add__(self: Array, other: Union[int, float, Array], /) -> Array:
435 """
436 Performs the operation __add__.
437 """
438 other = self._check_allowed_dtypes(other, "numeric", "__add__")
439 if other is NotImplemented:
440 return other
441 self, other = self._normalize_two_args(self, other)
442 res = self._array.__add__(other._array)
443 return self.__class__._new(res)
444
445 def __and__(self: Array, other: Union[int, bool, Array], /) -> Array:
446 """

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