[Tutor] Passing perimeters in dictionary values?

Richard Lovely roadierich at googlemail.com
Sun Mar 1 16:13:26 CET 2009


2009/2/28 Alan Gauld <alan.gauld at btinternet.com>:
>
> "Richard Lovely" <roadierich at googlemail.com> wrote
>
>> > Sorry, I should have pointed out that you will need to redefine
>> > all your functions to accept a parameter.
>>
>> Always makes me smile when (experienced) people redesign the wheel...
>>
>> From the docs (http://www.python.org/doc/2.6/library/functools.html):
>>
>> "The partial() is used for partial function application which
>> “freezes” some portion of a function’s arguments and/or keywords
>> resulting in a new object with a simplified signature."
>
> I'm not sure how you would use partial in this case, I still think you'd
> need to add a parameter to the function definitions. partial would
> remove the need for lambda in some of the other solutions though.
>
> But an interesting module that I've not seen before. Although since it was
> only introduced in 2.5 I'm not surprised, I've been focussing more
> on v3 lately rather than the new stuff in 2.5/2.6 (in fact I don't even
> have 2.6 loaded yet and only have 2.5 on one PC...)
>
> Thanks for highlighting it.
>
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>

Ooops... quoted the wrong message.  That should have been quoting the
message about lambdas...

-- 
Richard "Roadie Rich" Lovely, part of the JNP|UK Famile
www.theJNP.com


More information about the Tutor mailing list