mixins.pyi 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. from abc import ABCMeta, abstractmethod
  2. from typing import Literal as L, Any
  3. from numpy import ufunc
  4. __all__: list[str]
  5. # NOTE: `NDArrayOperatorsMixin` is not formally an abstract baseclass,
  6. # even though it's reliant on subclasses implementing `__array_ufunc__`
  7. # NOTE: The accepted input- and output-types of the various dunders are
  8. # completely dependent on how `__array_ufunc__` is implemented.
  9. # As such, only little type safety can be provided here.
  10. class NDArrayOperatorsMixin(metaclass=ABCMeta):
  11. @abstractmethod
  12. def __array_ufunc__(
  13. self,
  14. ufunc: ufunc,
  15. method: L["__call__", "reduce", "reduceat", "accumulate", "outer", "inner"],
  16. *inputs: Any,
  17. **kwargs: Any,
  18. ) -> Any: ...
  19. def __lt__(self, other: Any) -> Any: ...
  20. def __le__(self, other: Any) -> Any: ...
  21. def __eq__(self, other: Any) -> Any: ...
  22. def __ne__(self, other: Any) -> Any: ...
  23. def __gt__(self, other: Any) -> Any: ...
  24. def __ge__(self, other: Any) -> Any: ...
  25. def __add__(self, other: Any) -> Any: ...
  26. def __radd__(self, other: Any) -> Any: ...
  27. def __iadd__(self, other: Any) -> Any: ...
  28. def __sub__(self, other: Any) -> Any: ...
  29. def __rsub__(self, other: Any) -> Any: ...
  30. def __isub__(self, other: Any) -> Any: ...
  31. def __mul__(self, other: Any) -> Any: ...
  32. def __rmul__(self, other: Any) -> Any: ...
  33. def __imul__(self, other: Any) -> Any: ...
  34. def __matmul__(self, other: Any) -> Any: ...
  35. def __rmatmul__(self, other: Any) -> Any: ...
  36. def __imatmul__(self, other: Any) -> Any: ...
  37. def __truediv__(self, other: Any) -> Any: ...
  38. def __rtruediv__(self, other: Any) -> Any: ...
  39. def __itruediv__(self, other: Any) -> Any: ...
  40. def __floordiv__(self, other: Any) -> Any: ...
  41. def __rfloordiv__(self, other: Any) -> Any: ...
  42. def __ifloordiv__(self, other: Any) -> Any: ...
  43. def __mod__(self, other: Any) -> Any: ...
  44. def __rmod__(self, other: Any) -> Any: ...
  45. def __imod__(self, other: Any) -> Any: ...
  46. def __divmod__(self, other: Any) -> Any: ...
  47. def __rdivmod__(self, other: Any) -> Any: ...
  48. def __pow__(self, other: Any) -> Any: ...
  49. def __rpow__(self, other: Any) -> Any: ...
  50. def __ipow__(self, other: Any) -> Any: ...
  51. def __lshift__(self, other: Any) -> Any: ...
  52. def __rlshift__(self, other: Any) -> Any: ...
  53. def __ilshift__(self, other: Any) -> Any: ...
  54. def __rshift__(self, other: Any) -> Any: ...
  55. def __rrshift__(self, other: Any) -> Any: ...
  56. def __irshift__(self, other: Any) -> Any: ...
  57. def __and__(self, other: Any) -> Any: ...
  58. def __rand__(self, other: Any) -> Any: ...
  59. def __iand__(self, other: Any) -> Any: ...
  60. def __xor__(self, other: Any) -> Any: ...
  61. def __rxor__(self, other: Any) -> Any: ...
  62. def __ixor__(self, other: Any) -> Any: ...
  63. def __or__(self, other: Any) -> Any: ...
  64. def __ror__(self, other: Any) -> Any: ...
  65. def __ior__(self, other: Any) -> Any: ...
  66. def __neg__(self) -> Any: ...
  67. def __pos__(self) -> Any: ...
  68. def __abs__(self) -> Any: ...
  69. def __invert__(self) -> Any: ...