summaryrefslogtreecommitdiff
path: root/pylint/test/input/func_noerror_unused_variable_py30.py
blob: ffcc9783f9a38f2a37d8f425fe19ccd30d576875 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
""" Test nonlocal uses and unused-variable. """

__revision__ = 1

def test_nonlocal():
    """ Test that assigning to a nonlocal does not trigger
    an 'unused-variable' warnings.
    """
    attr = True
    def set_value(val):
        """ Set the value in a nonlocal. """
        nonlocal attr
        attr = val
    return set_value