Skip to content

Commit 791194c

Browse files
authored
Make operator protocol operands positional-only (#16809)
1 parent 4d46730 commit 791194c

1 file changed

Lines changed: 33 additions & 33 deletions

File tree

‎stdlib/_operator.pyi‎

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -43,135 +43,135 @@ class _SupportsPos(Protocol[_T_co]):
4343

4444
@type_check_only
4545
class _SupportsAnd(Protocol[_T_contra, _T_co]):
46-
def __and__(self, other: _T_contra) -> _T_co: ...
46+
def __and__(self, other: _T_contra, /) -> _T_co: ...
4747

4848
@type_check_only
4949
class _SupportsRAnd(Protocol[_T_contra, _T_co]):
50-
def __rand__(self, other: _T_contra) -> _T_co: ...
50+
def __rand__(self, other: _T_contra, /) -> _T_co: ...
5151

5252
@type_check_only
5353
class _SupportsLShift(Protocol[_T_contra, _T_co]):
54-
def __lshift__(self, other: _T_contra) -> _T_co: ...
54+
def __lshift__(self, other: _T_contra, /) -> _T_co: ...
5555

5656
@type_check_only
5757
class _SupportsRLShift(Protocol[_T_contra, _T_co]):
58-
def __rlshift__(self, other: _T_contra) -> _T_co: ...
58+
def __rlshift__(self, other: _T_contra, /) -> _T_co: ...
5959

6060
@type_check_only
6161
class _SupportsRShift(Protocol[_T_contra, _T_co]):
62-
def __rshift__(self, other: _T_contra) -> _T_co: ...
62+
def __rshift__(self, other: _T_contra, /) -> _T_co: ...
6363

6464
@type_check_only
6565
class _SupportsRRShift(Protocol[_T_contra, _T_co]):
66-
def __rrshift__(self, other: _T_contra) -> _T_co: ...
66+
def __rrshift__(self, other: _T_contra, /) -> _T_co: ...
6767

6868
@type_check_only
6969
class _SupportsTrueDiv(Protocol[_T_contra, _T_co]):
70-
def __truediv__(self, other: _T_contra) -> _T_co: ...
70+
def __truediv__(self, other: _T_contra, /) -> _T_co: ...
7171

7272
@type_check_only
7373
class _SupportsRTrueDiv(Protocol[_T_contra, _T_co]):
74-
def __rtruediv__(self, other: _T_contra) -> _T_co: ...
74+
def __rtruediv__(self, other: _T_contra, /) -> _T_co: ...
7575

7676
@type_check_only
7777
class _SupportsFloorDiv(Protocol[_T_contra, _T_co]):
78-
def __floordiv__(self, other: _T_contra) -> _T_co: ...
78+
def __floordiv__(self, other: _T_contra, /) -> _T_co: ...
7979

8080
@type_check_only
8181
class _SupportsRFloorDiv(Protocol[_T_contra, _T_co]):
82-
def __rfloordiv__(self, other: _T_contra) -> _T_co: ...
82+
def __rfloordiv__(self, other: _T_contra, /) -> _T_co: ...
8383

8484
@type_check_only
8585
class _SupportsMod(Protocol[_T_contra, _T_co]):
86-
def __mod__(self, other: _T_contra) -> _T_co: ...
86+
def __mod__(self, other: _T_contra, /) -> _T_co: ...
8787

8888
@type_check_only
8989
class _SupportsRMod(Protocol[_T_contra, _T_co]):
90-
def __rmod__(self, other: _T_contra) -> _T_co: ...
90+
def __rmod__(self, other: _T_contra, /) -> _T_co: ...
9191

9292
@type_check_only
9393
class _SupportsMatMul(Protocol[_T_contra, _T_co]):
94-
def __matmul__(self, other: _T_contra) -> _T_co: ...
94+
def __matmul__(self, other: _T_contra, /) -> _T_co: ...
9595

9696
@type_check_only
9797
class _SupportsRMatMul(Protocol[_T_contra, _T_co]):
98-
def __rmatmul__(self, other: _T_contra) -> _T_co: ...
98+
def __rmatmul__(self, other: _T_contra, /) -> _T_co: ...
9999

100100
@type_check_only
101101
class _SupportsOr(Protocol[_T_contra, _T_co]):
102-
def __or__(self, other: _T_contra) -> _T_co: ...
102+
def __or__(self, other: _T_contra, /) -> _T_co: ...
103103

104104
@type_check_only
105105
class _SupportsROr(Protocol[_T_contra, _T_co]):
106-
def __ror__(self, other: _T_contra) -> _T_co: ...
106+
def __ror__(self, other: _T_contra, /) -> _T_co: ...
107107

108108
@type_check_only
109109
class _SupportsPow(Protocol[_T_contra, _T_co]):
110-
def __pow__(self, other: _T_contra) -> _T_co: ...
110+
def __pow__(self, other: _T_contra, /) -> _T_co: ...
111111

112112
@type_check_only
113113
class _SupportsRPow(Protocol[_T_contra, _T_co]):
114-
def __rpow__(self, other: _T_contra) -> _T_co: ...
114+
def __rpow__(self, other: _T_contra, /) -> _T_co: ...
115115

116116
@type_check_only
117117
class _SupportsXOr(Protocol[_T_contra, _T_co]):
118-
def __xor__(self, other: _T_contra) -> _T_co: ...
118+
def __xor__(self, other: _T_contra, /) -> _T_co: ...
119119

120120
@type_check_only
121121
class _SupportsRXOr(Protocol[_T_contra, _T_co]):
122-
def __rxor__(self, other: _T_contra) -> _T_co: ...
122+
def __rxor__(self, other: _T_contra, /) -> _T_co: ...
123123

124124
@type_check_only
125125
class _SupportsIAdd(Protocol[_T_contra, _T_co]):
126-
def __iadd__(self, other: _T_contra) -> _T_co: ...
126+
def __iadd__(self, other: _T_contra, /) -> _T_co: ...
127127

128128
@type_check_only
129129
class _SupportsIAnd(Protocol[_T_contra, _T_co]):
130-
def __iand__(self, other: _T_contra) -> _T_co: ...
130+
def __iand__(self, other: _T_contra, /) -> _T_co: ...
131131

132132
@type_check_only
133133
class _SupportsILShift(Protocol[_T_contra, _T_co]):
134-
def __ilshift__(self, other: _T_contra) -> _T_co: ...
134+
def __ilshift__(self, other: _T_contra, /) -> _T_co: ...
135135

136136
@type_check_only
137137
class _SupportsIMod(Protocol[_T_contra, _T_co]):
138-
def __imod__(self, other: _T_contra) -> _T_co: ...
138+
def __imod__(self, other: _T_contra, /) -> _T_co: ...
139139

140140
@type_check_only
141141
class _SupportsIMul(Protocol[_T_contra, _T_co]):
142-
def __imul__(self, other: _T_contra) -> _T_co: ...
142+
def __imul__(self, other: _T_contra, /) -> _T_co: ...
143143

144144
@type_check_only
145145
class _SupportsIMatMul(Protocol[_T_contra, _T_co]):
146-
def __imatmul__(self, other: _T_contra) -> _T_co: ...
146+
def __imatmul__(self, other: _T_contra, /) -> _T_co: ...
147147

148148
@type_check_only
149149
class _SupportsIOr(Protocol[_T_contra, _T_co]):
150-
def __ior__(self, other: _T_contra) -> _T_co: ...
150+
def __ior__(self, other: _T_contra, /) -> _T_co: ...
151151

152152
@type_check_only
153153
class _SupportsIPow(Protocol[_T_contra, _T_co]):
154-
def __ipow__(self, other: _T_contra) -> _T_co: ...
154+
def __ipow__(self, other: _T_contra, /) -> _T_co: ...
155155

156156
@type_check_only
157157
class _SupportsIRShift(Protocol[_T_contra, _T_co]):
158-
def __irshift__(self, other: _T_contra) -> _T_co: ...
158+
def __irshift__(self, other: _T_contra, /) -> _T_co: ...
159159

160160
@type_check_only
161161
class _SupportsISub(Protocol[_T_contra, _T_co]):
162-
def __isub__(self, other: _T_contra) -> _T_co: ...
162+
def __isub__(self, other: _T_contra, /) -> _T_co: ...
163163

164164
@type_check_only
165165
class _SupportsITrueDiv(Protocol[_T_contra, _T_co]):
166-
def __itruediv__(self, other: _T_contra) -> _T_co: ...
166+
def __itruediv__(self, other: _T_contra, /) -> _T_co: ...
167167

168168
@type_check_only
169169
class _SupportsIXOr(Protocol[_T_contra, _T_co]):
170-
def __ixor__(self, other: _T_contra) -> _T_co: ...
170+
def __ixor__(self, other: _T_contra, /) -> _T_co: ...
171171

172172
@type_check_only
173173
class _SupportsIFloorDiv(Protocol[_T_contra, _T_co]):
174-
def __ifloordiv__(self, other: _T_contra) -> _T_co: ...
174+
def __ifloordiv__(self, other: _T_contra, /) -> _T_co: ...
175175

176176
@type_check_only
177177
class _SupportsIConcat(Protocol[_T_contra, _T_co]):

0 commit comments

Comments
 (0)