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_base_init_vars.py @ 745
History | View | Annotate | Download (772 Bytes)
1 |
# pylint:disable=R0201, print-statement, too-few-public-methods
|
---|---|
2 |
"""Checks that class variables are seen as inherited !
|
3 |
"""
|
4 |
__revision__ = ''
|
5 |
|
6 |
class BaseClass(object): |
7 |
"""A simple base class
|
8 |
"""
|
9 |
|
10 |
def __init__(self): |
11 |
self.base_var = {}
|
12 |
|
13 |
def met(self): |
14 |
"""yo"""
|
15 |
def meeting(self, with_): |
16 |
"""ye"""
|
17 |
return with_
|
18 |
class MyClass(BaseClass): |
19 |
"""Inherits from BaseClass
|
20 |
"""
|
21 |
|
22 |
def __init__(self): |
23 |
BaseClass.__init__(self)
|
24 |
self.var = {}
|
25 |
|
26 |
def met(self): |
27 |
"""Checks that base_var is not seen as defined outsite '__init__'
|
28 |
"""
|
29 |
self.var[1] = 'one' |
30 |
self.base_var[1] = 'one' |
31 |
return self.base_var, self.var |
32 |
|
33 |
if __name__ == '__main__': |
34 |
OBJ = MyClass() |
35 |
OBJ.met() |