You're right! It was my fault. I left the colon after the lambda by mistake. e.g. lambda: num=verseNum:...I tried it but I got a syntax error. The interpreter didn't like the equals sign in the lambda. I am using python 2.3.4. Is there another way of writing that?
Strange. This script works and shows the desired behaviour - python is also 2.3.4:
def foo(x): print x
fs = [lambda: foo(i) for i in xrange(5)] for f in fs: f()
fs = [lambda x=i: foo(x) for i in xrange(5)] for f in fs: f()
Thanks very much for the help it works great now! I wish I would have asked somebody sooner :)
-Matthew
--
http://mail.python.org/mailman/listinfo/python-list