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