From 8f12a6b88cf9f9956cd86f11ad32838ae74d918b Mon Sep 17 00:00:00 2001 From: neingeist Date: Thu, 2 Nov 2017 02:51:11 +0100 Subject: [PATCH] add trickyscope.py --- trickyscope.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 trickyscope.py diff --git a/trickyscope.py b/trickyscope.py new file mode 100644 index 0000000..e59c5b8 --- /dev/null +++ b/trickyscope.py @@ -0,0 +1,9 @@ +from __future__ import print_function + +class TrickyScope: + a = 1 + b = [a for i in range(1)] + +# Does not work with Python 3: +print(type(TrickyScope.b)) +assert TrickyScope.b == [1]