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 f78d155 commit 3ee1591Copy full SHA for 3ee1591
src/array_api_typing/_array.py
@@ -50,9 +50,28 @@ def __pos__(self) -> Self:
50
...
51
52
53
+class CanArrayNeg(Protocol):
54
+ """Protocol for array classes that support the unary minus operator."""
55
+
56
+ def __neg__(self) -> Self:
57
+ """Evaluates `-self_i` for each element of an array instance.
58
59
+ Returns:
60
+ Self: an array containing the evaluated result for each element in
61
+ self. The returned array must have a data type determined by Type
62
+ Promotion Rules.
63
64
+ See Also:
65
+ array_api_typing.Negative
66
67
+ """
68
+ ...
69
70
71
class Array(
72
HasArrayNamespace[NS_co],
73
CanArrayPos,
74
+ CanArrayNeg,
75
Protocol,
76
):
77
"""Array API specification for array object attributes and methods."""
0 commit comments