Event Binding and Variable Passing

Cameron Laird claird at starbase.neosoft.com
Sun Jun 25 23:49:13 EDT 2000


In article <39567A5A.5B692C5D at pacbell.net>,
Bruce Wolk  <bawolk at ucdavis.edu> wrote:
>You need to use a lamda expression.
>
>def fun(x):
>	print x
>b.bind('<Button-1>', lambda event, b=x: fun(b))
			.
			.
			.
Can one of the old(er?)-timers help me with this?
There's a sect (claiming the Guido among its sym-
pathizers) that deprecates lambdas for Python, no?
But their reasons (very abstractly, that object-
oriented metaprogramming gives more than enough
goodies, making lambdas essentially redundant) do
*not* apply for communication with the event- and
binding-mechanisms adapted from Tcl, true?  The
conclusion would be, then, that Tkinter forces a
fundamental need for lambdas.
-- 

Cameron Laird <claird at NeoSoft.com>
Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



More information about the Python-list mailing list