From c3bc8d7b2b372abf154aeddf762f5e2b859a0e5b Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 27 Nov 2017 14:14:57 +1100 Subject: [PATCH] tests/basics/builtin_locals: Add test for using locals() in class body. --- tests/basics/builtin_locals.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/basics/builtin_locals.py b/tests/basics/builtin_locals.py index 3689216ef6..e60759a40e 100644 --- a/tests/basics/builtin_locals.py +++ b/tests/basics/builtin_locals.py @@ -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())