File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-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 @@ -60,10 +60,27 @@ def __neg__(self) -> Self:
60
60
...
61
61
62
62
63
+ class HasArrayAdd (Protocol ):
64
+ """Protocol for array classes that support the addition operator."""
65
+
66
+ def __add__ (self , other : Self | int | float , / ) -> Self :
67
+ """Calculates the sum for each element of an array instance with the respective element of the array other.
68
+
69
+ Args:
70
+ other: addend array. Must be compatible with self (see Broadcasting). Should have a numeric data type.
71
+
72
+ Returns:
73
+ an array containing the element-wise sums. The returned array must have a data type determined by Type Promotion Rules.
74
+
75
+ """ # noqa: E501
76
+ ...
77
+
78
+
63
79
class Array (
64
80
HasArrayNamespace [NS_co ],
65
81
HasArrayPos ,
66
82
HasArrayNeg ,
83
+ HasArrayAdd ,
67
84
Protocol ,
68
85
):
69
86
"""Array API specification for array object attributes and methods."""
You can’t perform that action at this time.
0 commit comments