10 May
2009
10 May
'09
5:28 a.m.
Any argument for changing to a more "dynamic" default scheme had better have a definition of the behavior of the following code, and produce a good rationale for that behavior: x = 5 def function_producer(y): def inner(arg=x+y): return arg + 2 return inner x = 6 f1 = function_producer(x) x = 4.1 y = 7 f2 = function_producer(3) print x, y, f1(), f2() del y x = 45 print x, f1(), f2() del x print f1(), f2() --Scott David Daniels Scott.Daniels@Acm.Org