passing data to Tkinter call backs
Bruno Desthuilliers
bruno.42.desthuilliers at websiteburo.invalid
Wed Jun 9 09:47:59 EDT 2010
Nick Keighley a écrit :
> On 9 June, 13:50, Bruno Desthuilliers <bruno.
(snip)
>> Note that the lambda trick you used is very idiomatic - functool.partial
>> being newer and probably not as used - so one could argue that the most
>> common way is also the most "elegant" !-)
>
> I'm somewhat newbie at Python but I'd seen lambda elsewhere (scheme).
> I like the closure trick...
Well... Python is not Scheme - specially wrt/ lambdas and closures.
While it has some restricted support for some FP idioms, Python is
definitly an OO language.
FWIW, you could implement the functool.partial class using closures /
HOF (and it's been done before), but it's easier and just more "obvious"
to take the OO route here.
More information about the Python-list
mailing list