Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #55728

Re: Parameterized functions of no arguments?

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Parameterized functions of no arguments?
Date 2011-02-10 23:22 -0800
Organization > Bestiaria Support Staff <
References <ij2fdr$uo7$1@news.eternal-september.org>
Newsgroups comp.lang.python
Message-ID <mailman.93.1297408937.1633.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, 11 Feb 2011 04:54:11 +0000, Rotwang <sg552@hotmail.co.uk>
declaimed the following in gmane.comp.python.general:

>          menu.add_command(label = str(k), command = lambda: f(k))
>

	I'm not sure, but what effect does

		menu.add_command(label=str(k), command = lambda k=k: f(k))

have on the processing.

	Confusing syntax, I know... does it make more sense as 
			... lambda x=k: f(x)...

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Parameterized functions of no arguments? Rotwang <sg552@hotmail.co.uk> - 2011-02-11 04:54 +0000
  Re: Parameterized functions of no arguments? Hrvoje Niksic <hniksic@xemacs.org> - 2011-02-11 15:43 +0100
  Re: Parameterized functions of no arguments? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-02-10 23:22 -0800
  Re: Parameterized functions of no arguments? Carl Banks <pavlovevidence@gmail.com> - 2011-02-11 05:59 +0000
  Re: Parameterized functions of no arguments? Chris Rebert <clp2@rebertia.com> - 2011-02-10 21:50 -0800
  Re: Parameterized functions of no arguments? Rotwang <sg552@hotmail.co.uk> - 2011-02-11 05:26 +0000

csiph-web