-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce B902: enforce use of self and cls as first arguments in met…
…hods
- Loading branch information
Lukasz Langa
committed
Feb 15, 2017
1 parent
df48ad1
commit ff6afda
Showing
4 changed files
with
192 additions
and
33 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
def not_a_method(arg1): | ||
... | ||
|
||
|
||
class NoWarnings: | ||
def __init__(self): | ||
def not_a_method_either(arg1): | ||
... | ||
|
||
def __new__(cls, *args, **kwargs): | ||
... | ||
|
||
def method(self, arg1, *, yeah): | ||
... | ||
|
||
@classmethod | ||
def someclassmethod(cls, arg1, with_default=None): | ||
... | ||
|
||
@staticmethod | ||
def not_a_problem(arg1): | ||
... | ||
|
||
|
||
class Warnings: | ||
def __init__(i_am_special): | ||
... | ||
|
||
def almost_a_class_method(cls, arg1): | ||
... | ||
|
||
def almost_a_static_method(): | ||
... | ||
|
||
@classmethod | ||
def wat(self, i_like_confusing_people): | ||
... | ||
|
||
def i_am_strange(*args, **kwargs): | ||
self = args[0] | ||
|
||
def defaults_anyone(self=None): | ||
... | ||
|
||
def invalid_kwargs_only(**kwargs): | ||
... | ||
|
||
def invalid_keyword_only(*, self): | ||
... |
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