okwrap in lambda to defer is always equivalent to the longerand to some observers less convenientdoublefunction formdef handler(name)print(namedef temp()handler('spam'button(command=tempokrefence but do not call we need only the zero-argument lambda or the zero-argument callable referencethoughnot both--it makes no sense to code lambda which simply calls function if no extra data must be passed in and only adds an extra pointless calldef handler(name)print(namedef temp()handler('spam'button(command=(lambdatemp())badthis adds pointless callas we'll see laterthis includes references to other callables like bound methods and callable instances which retain state in themselves--if they take zero arguments when calledwe can simply name them at widget construction timeand we don' need to wrap them in superfluous lambda callback scope issues although the prior section' lambda and intermediate function techniques defer calls and allow extra data to be passed inthey also raise some scoping issues that may seem subtle at first glance this is core language territorybut it comes up often in practice in conjunction with gui arguments versus globals for instancenotice that the handler function in the prior section' initial code could also refer to directlybecause it is global variable (and would exist by the time the code inside the handler is runbecause of thatwe might make the handler oneargument function and pass in just the string 'spamin the lambdadef handler( )use global and argument is in my global scopeimplicitly button(text='ni'command=(lambdahandler('spam'))adding user-defined callback handlers