File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,8 @@ version_tuple = {version_tuple!r}
137
137
" FBT" , # flake8-boolean-trap
138
138
" FIX" , # flake8-fixme
139
139
" ISC001" , # Conflicts with formatter
140
+ " PLW1641" , # Object does not implement `__hash__` method
141
+ " PYI041" , # Use `float` instead of `int | float`
140
142
]
141
143
142
144
[tool .ruff .lint .per-file-ignores ]
Original file line number Diff line number Diff line change @@ -66,10 +66,32 @@ def __neg__(self) -> Self:
66
66
...
67
67
68
68
69
+ class CanArrayAdd (Protocol ):
70
+ """Protocol for array classes that support the addition operator."""
71
+
72
+ def __add__ (self , other : Self | int | float , / ) -> Self :
73
+ """Calculates the sum for each element of an array instance with the respective element of the array `other`.
74
+
75
+ Args:
76
+ other: addend array. Must be compatible with `self` (see
77
+ Broadcasting). Should have a numeric data type.
78
+
79
+ Returns:
80
+ Self: an array containing the element-wise sums. The returned array
81
+ must have a data type determined by Type Promotion Rules.
82
+
83
+ See Also:
84
+ array_api_typing.Add
85
+
86
+ """ # noqa: E501
87
+ ...
88
+
89
+
69
90
class Array (
70
91
HasArrayNamespace [NS_co ],
71
92
CanArrayPos ,
72
93
CanArrayNeg ,
94
+ CanArrayAdd ,
73
95
Protocol ,
74
96
):
75
97
"""Array API specification for array object attributes and methods."""
You can’t perform that action at this time.
0 commit comments