summaryrefslogtreecommitdiff
path: root/tests/functional/class_scope.py
blob: 309ebd6da3dfbf07405621f439fd5e77121eda2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# pylint: disable=R0903,W0232, useless-object-inheritance
"""check for scope problems"""

__revision__ = None

class Well(object):
    """well"""
    attr = 42
    get_attr = lambda arg=attr: arg * 24
    # +1: [used-before-assignment]
    get_attr_bad = lambda arg=revattr: revattr * 42
    revattr = 24
    bad_lambda = lambda: get_attr_bad # [undefined-variable]

    class Data(object):
        """base hidden class"""
    class Sub(Data):
        """whaou, is Data found???"""
        attr = Data() # [undefined-variable]
    def func(self):
        """check Sub is not defined here"""
        return Sub(), self # [undefined-variable]