changeset 177:6ae566bb1a99

add an example of lack of python closures
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 03 Nov 2011 10:39:22 -0700
parents b91750a108b2
children fa94f0b4459d
files python/closure.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/closure.py	Thu Nov 03 10:39:22 2011 -0700
@@ -0,0 +1,4 @@
+directory = 'foo'
+bar = lambda: directory
+directory = 'fleem'
+print bar()