blob: 79ae34879e5c56431113ebcd3897df75d2bfe56c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
"""Checks that missing self in method defs don't crash Pylint."""
# pylint: disable=useless-object-inheritance
class MyClass(object):
"""A class with some methods missing self args."""
def __init__(self):
self.var = "var"
def method(): # [no-method-argument]
"""A method without a self argument."""
def setup(): # [no-method-argument]
"""A method without a self argument, but usage."""
self.var = 1 # [undefined-variable]
def correct(self):
"""Correct."""
self.var = "correct"
|