summaryrefslogtreecommitdiff
path: root/test/input/func_noerror_base_init_vars.py
blob: 0870cef12039a38dedae6d46967903436cb4cf50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# pylint:disable=R0201
"""Checks that class variables are seen as inherited !
"""
__revision__ = ''

class BaseClass(object):
    """A simple base class
    """

    def __init__(self):
        self.base_var = {}

    def met(self):
        """yo"""
    def meeting(self, with_):
        """ye"""
        return with_
class MyClass(BaseClass):
    """Inherits from BaseClass
    """

    def __init__(self):
        BaseClass.__init__(self)
        self.var = {}

    def met(self):
        """Checks that base_var is not seen as defined outsite '__init__'
        """
        self.var[1] = 'one'
        self.base_var[1] = 'one'
        print self.base_var, self.var

if __name__ == '__main__':
    OBJ = MyClass()
    OBJ.met()