Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reverse the order of positional args check in _check_first_arg_for_type
Because the positional only arguments can appear before the normal positional or keyword arguments, we need to first check the positional only ones for the purpose of bad-mcs-* and similar methods. Close #3230
- Loading branch information
1 parent
c65cce4
commit d00e191
Showing
3 changed files
with
24 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Test linting. | ||
This is only intended to test pylint support for python 3.8's | ||
positional-only arguments (PEP 570). | ||
""" | ||
|
||
|
||
class Foobar: | ||
"""Class for frobulating the Foobar.""" | ||
|
||
@classmethod | ||
def buildme(cls, /, value): | ||
"""Construct object using alternate method.""" | ||
return cls(value).abc | ||
|
||
def runme(self, qrs, /, xyz=None): | ||
"""Do something funcy.""" | ||
if self.abc and qrs and xyz: | ||
print("found something else") |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[testoptions] | ||
min_pyver=3.8 |