[Tutor] Can a method be added to dictionary?
Lie Ryan
lie.1296 at gmail.com
Fri Nov 20 13:43:27 CET 2009
lauren at protopc.com wrote:
> John,
>
> Thank you so much for your help! -- Problem SOLVED!!! -- Your explanation
> and example was extremely helpful. I am very grateful.
>
> Lauren :-)
if you want to pass an argument, you can "curry" the function with
functools.partial()
# currying the function, don't execute yet..
d = {'abc': functools.partial(func, arg1, arg2, arg3),
}
# execute the curried function now
d['abc']()
More information about the Tutor
mailing list