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 / input / func_noerror_static_method.py @ 745
History | View | Annotate | Download (653 Bytes)
1 |
"""Checks if static / class methods works fine in Pylint
|
---|---|
2 |
"""
|
3 |
from __future__ import print_function |
4 |
__revision__ = ''
|
5 |
|
6 |
#pylint: disable=no-classmethod-decorator, no-staticmethod-decorator
|
7 |
class MyClass(object): |
8 |
"""doc
|
9 |
"""
|
10 |
def __init__(self): |
11 |
pass
|
12 |
|
13 |
def static_met(var1, var2): |
14 |
"""This is a static method
|
15 |
"""
|
16 |
print(var1, var2) |
17 |
|
18 |
def class_met(cls, var1): |
19 |
"""This is a class method
|
20 |
"""
|
21 |
print(cls, var1) |
22 |
|
23 |
static_met = staticmethod(static_met)
|
24 |
class_met = classmethod(class_met)
|
25 |
|
26 |
if __name__ == '__main__': |
27 |
MyClass.static_met("var1", "var2") |
28 |
MyClass.class_met("var1")
|