gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / pylint / test / functional / missing_self_argument.py @ 745
History | View | Annotate | Download (510 Bytes)
1 |
"""Checks that missing self in method defs don't crash Pylint."""
|
---|---|
2 |
|
3 |
|
4 |
|
5 |
class MyClass(object): |
6 |
"""A class with some methods missing self args."""
|
7 |
|
8 |
def __init__(self): |
9 |
self.var = "var" |
10 |
|
11 |
def method(): # [no-method-argument] |
12 |
"""A method without a self argument."""
|
13 |
|
14 |
def setup(): # [no-method-argument] |
15 |
"""A method without a self argument, but usage."""
|
16 |
self.var = 1 # [undefined-variable] |
17 |
|
18 |
def correct(self): |
19 |
"""Correct."""
|
20 |
self.var = "correct" |