mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
tests/basics/builtin_locals: Add test for using locals() in class body.
This commit is contained in:
@@ -2,3 +2,12 @@
|
|||||||
|
|
||||||
x = 123
|
x = 123
|
||||||
print(locals()['x'])
|
print(locals()['x'])
|
||||||
|
|
||||||
|
class A:
|
||||||
|
y = 1
|
||||||
|
def f(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
print('x' in locals())
|
||||||
|
print(locals()['y'])
|
||||||
|
print('f' in locals())
|
||||||
|
|||||||
Reference in New Issue
Block a user