tests/basics/builtin_locals: Add test for using locals() in class body.
This commit is contained in:
parent
84895f1a21
commit
c3bc8d7b2b
@ -2,3 +2,12 @@
|
||||
|
||||
x = 123
|
||||
print(locals()['x'])
|
||||
|
||||
class A:
|
||||
y = 1
|
||||
def f(self):
|
||||
pass
|
||||
|
||||
print('x' in locals())
|
||||
print(locals()['y'])
|
||||
print('f' in locals())
|
||||
|
Loading…
Reference in New Issue
Block a user