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}
137137 " FBT" , # flake8-boolean-trap
138138 " FIX" , # flake8-fixme
139139 " ISC001" , # Conflicts with formatter
140+ " PLW1641" , # Object does not implement `__hash__` method
141+ " PYI041" , # Use `float` instead of `int | float`
140142 ]
141143
142144 [tool .ruff .lint .per-file-ignores ]
Original file line number Diff line number Diff line change @@ -66,10 +66,32 @@ def __neg__(self) -> Self:
6666 ...
6767
6868
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+
6990class Array (
7091 HasArrayNamespace [NS_co ],
7192 CanArrayPos ,
7293 CanArrayNeg ,
94+ CanArrayAdd ,
7395 Protocol ,
7496):
7597 """Array API specification for array object attributes and methods."""
You can’t perform that action at this time.
0 commit comments