|
1 | 1 | # pylint: disable=missing-docstring,too-few-public-methods
|
2 | 2 | class AbstractFoo:
|
3 | 3 |
|
4 |
| - def kwonly_1(self, first, *, second, third): |
| 4 | + def kwonly_1(self, first: int, *, second: int, third: int): |
5 | 5 | "Normal positional with two positional only params."
|
6 | 6 |
|
7 |
| - def kwonly_2(self, *, first, second): |
| 7 | + def kwonly_2(self, *, first: str, second: str): |
8 | 8 | "Two positional only parameter."
|
9 | 9 |
|
10 |
| - def kwonly_3(self, *, first, second): |
| 10 | + def kwonly_3(self, *, first: str, second: str): |
11 | 11 | "Two positional only params."
|
12 | 12 |
|
13 |
| - def kwonly_4(self, *, first, second=None): |
| 13 | + def kwonly_4(self, *, first: str, second=None): |
14 | 14 | "One positional only and another with a default."
|
15 | 15 |
|
16 |
| - def kwonly_5(self, *, first, **kwargs): |
| 16 | + def kwonly_5(self, *, first: bool, **kwargs): |
17 | 17 | "Keyword only and keyword variadics."
|
18 | 18 |
|
19 |
| - def kwonly_6(self, first, second, *, third): |
| 19 | + def kwonly_6(self, first: float, second: float, *, third: int): |
20 | 20 | "Two positional and one keyword"
|
21 | 21 |
|
22 | 22 |
|
23 | 23 | class Foo(AbstractFoo):
|
24 | 24 |
|
25 |
| - def kwonly_1(self, first, *, second): # [arguments-differ] |
| 25 | + def kwonly_1(self, first: int, *, second: int): # [arguments-differ] |
26 | 26 | "One positional and only one positional only param."
|
27 | 27 |
|
28 |
| - def kwonly_2(self, first): # [arguments-differ] |
| 28 | + def kwonly_2(self, *, first: str): # [arguments-differ] |
29 | 29 | "Only one positional parameter instead of two positional only parameters."
|
30 | 30 |
|
31 |
| - def kwonly_3(self, first, second): # [arguments-differ] |
| 31 | + def kwonly_3(self, **kwargs): |
32 | 32 | "Two positional params."
|
33 | 33 |
|
34 |
| - def kwonly_4(self, first, second): # [arguments-differ] |
| 34 | + def kwonly_4(self, *args): # [arguments-differ] |
35 | 35 | "Two positional params."
|
36 | 36 |
|
37 |
| - def kwonly_5(self, *, first): # [arguments-differ] |
| 37 | + def kwonly_5(self, *, first: bool): # [arguments-differ] |
38 | 38 | "Keyword only, but no variadics."
|
39 | 39 |
|
40 | 40 | def kwonly_6(self, *args, **kwargs): # valid override
|
|
0 commit comments