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