summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/builtin_locals.py
blob: e60759a40e12e96834c127bc6cc025a17d2eee91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# test builtin locals()

x = 123
print(locals()['x'])

class A:
    y = 1
    def f(self):
        pass

    print('x' in locals())
    print(locals()['y'])
    print('f' in locals())