File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ version_tuple = {version_tuple!r}
127
127
" D107" , # Missing docstring in __init__
128
128
" D203" , # 1 blank line required before class docstring
129
129
" D213" , # Multi-line docstring summary should start at the second line
130
+ " D401" , # First line of docstring should be in imperative mood
130
131
" FBT" , # flake8-boolean-trap
131
132
" FIX" , # flake8-fixme
132
133
" ISC001" , # Conflicts with formatter
Original file line number Diff line number Diff line change 5
5
6
6
from types import ModuleType
7
7
from typing import Literal , Protocol
8
- from typing_extensions import TypeVar
8
+ from typing_extensions import Self , TypeVar
9
9
10
10
NS_co = TypeVar ("NS_co" , covariant = True , default = ModuleType )
11
11
@@ -33,8 +33,26 @@ def __array_namespace__(
33
33
) -> NS_co : ...
34
34
35
35
36
+ class CanArrayPos (Protocol ):
37
+ """Protocol for array classes that support the unary plus operator."""
38
+
39
+ def __pos__ (self ) -> Self :
40
+ """Evaluates `+self_i` for each element of an array instance.
41
+
42
+ Returns:
43
+ Self: An array containing the evaluated result for each element.
44
+ The returned array must have the same data type as self.
45
+
46
+ See Also:
47
+ array_api_typing.Positive
48
+
49
+ """
50
+ ...
51
+
52
+
36
53
class Array (
37
54
HasArrayNamespace [NS_co ],
55
+ CanArrayPos ,
38
56
Protocol ,
39
57
):
40
58
"""Array API specification for array object attributes and methods."""
You can’t perform that action at this time.
0 commit comments