We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 637b592 commit 76b0245Copy full SHA for 76b0245
src/array_api_typing/_array.py
@@ -45,9 +45,25 @@ def __pos__(self) -> Self:
45
...
46
47
48
+class HasArrayNeg(Protocol):
49
+ """Protocol for array classes that support the unary minus operator."""
50
+
51
+ def __neg__(self) -> Self:
52
+ """Evaluates -self_i for each element of an array instance.
53
54
+ Returns:
55
+ an array containing the evaluated result for each element in self.
56
+ The returned array must have a data type determined by Type
57
+ Promotion Rules.
58
59
+ """
60
+ ...
61
62
63
class Array(
64
HasArrayNamespace[NS_co],
65
HasArrayPos,
66
+ HasArrayNeg,
67
Protocol,
68
):
69
"""Array API specification for array object attributes and methods."""
0 commit comments