-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove type check from arguments-differ
- Loading branch information
Showing
4 changed files
with
66 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
arguments-differ:12:4:Child.test:Number of parameters was 1 in 'Parent.test' and is now 2 in overridden 'Child.test' method | ||
arguments-differ:23:4:ChildDefaults.test:Number of parameters was 3 in 'ParentDefaults.test' and is now 2 in overridden 'ChildDefaults.test' method | ||
arguments-differ:41:4:ClassmethodChild.func:Number of parameters was 2 in 'Classmethod.func' and is now 0 in overridden 'ClassmethodChild.func' method | ||
arguments-differ:68:4:VarargsChild.has_kwargs:Parameter 'arg' was of type 'bool' and is now of type 'int' in overridden 'VarargsChild.has_kwargs' method | ||
arguments-differ:68:4:VarargsChild.has_kwargs:Variadics removed in overridden 'VarargsChild.has_kwargs' method | ||
arguments-differ:71:4:VarargsChild.no_kwargs:Parameter 'args' has been renamed to 'arg' in overridden 'VarargsChild.no_kwargs' method | ||
arguments-differ:172:4:SecondChangesArgs.test:Number of parameters was 2 in 'FirstHasArgs.test' and is now 4 in overridden 'SecondChangesArgs.test' method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
# pylint: disable=missing-docstring,too-few-public-methods | ||
class AbstractFoo: | ||
|
||
def kwonly_1(self, first: int, *, second: int, third: int): | ||
def kwonly_1(self, first, *, second, third): | ||
"Normal positional with two positional only params." | ||
|
||
def kwonly_2(self, *, first: str, second: str): | ||
def kwonly_2(self, *, first, second): | ||
"Two positional only parameter." | ||
|
||
def kwonly_3(self, *, first: str, second: str): | ||
def kwonly_3(self, *, first, second): | ||
"Two positional only params." | ||
|
||
def kwonly_4(self, *, first: str, second=None): | ||
def kwonly_4(self, *, first, second=None): | ||
"One positional only and another with a default." | ||
|
||
def kwonly_5(self, *, first: bool, **kwargs): | ||
def kwonly_5(self, *, first, **kwargs): | ||
"Keyword only and keyword variadics." | ||
|
||
def kwonly_6(self, first: float, second: float, *, third: int): | ||
def kwonly_6(self, first, second, *, third): | ||
"Two positional and one keyword" | ||
|
||
|
||
class Foo(AbstractFoo): | ||
|
||
def kwonly_1(self, first: int, *, second: int): # [arguments-differ] | ||
def kwonly_1(self, first, *, second): # [arguments-differ] | ||
"One positional and only one positional only param." | ||
|
||
def kwonly_2(self, *, first: str): # [arguments-differ] | ||
def kwonly_2(self, *, first): # [arguments-differ] | ||
"Only one positional parameter instead of two positional only parameters." | ||
|
||
def kwonly_3(self, first, second): # [arguments-differ] | ||
def kwonly_3(self, first, second): # [arguments-differ] | ||
"Two positional params." | ||
|
||
def kwonly_4(self, first, second): # [arguments-differ] | ||
def kwonly_4(self, first, second): # [arguments-differ] | ||
"Two positional params." | ||
|
||
def kwonly_5(self, *, first: bool): # [arguments-differ] | ||
def kwonly_5(self, *, first): # [arguments-differ] | ||
"Keyword only, but no variadics." | ||
|
||
def kwonly_6(self, *args, **kwargs): # valid override | ||
def kwonly_6(self, *args, **kwargs): # valid override | ||
"Positional and keyword variadics to pass through parent params" | ||
|
||
|
||
class Foo2(AbstractFoo): | ||
|
||
def kwonly_6(self, first, *args, **kwargs): # valid override | ||
def kwonly_6(self, first, *args, **kwargs): # valid override | ||
"One positional with the rest variadics to pass through parent params" |