Idea: "Frozen" inner function
Steve Horne
stephenwantshornenospam100 at aol.com
Mon Nov 27 14:52:00 PST 2006
On Mon, 27 Nov 2006 20:04:10 +0100, Michael Butscher
<mbutscher at gmx.de> wrote:
>Steve Horne wrote:
>> Maybe Python is doing the (1) thing, but that leaves me wondering how
>> come my existing code is working.
>
>Before closures were introduced in Python (about 2.2 or so), it was a
>common idiom to write:
>
>lambda a=a: ...
>
>to access an outer variable a. Maybe you are using something like that.
No. I used to, but it was a big relief when I didn't need to any more.
I'm not so sure now that I change variables much after using them like
this.
--
Remove 'wants' and 'nospam' from e-mail.
More information about the Digitalmars-d
mailing list