pythonic way of creating a curried function
|
| View previous topic :: View next topic |
| Author |
Message |
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
What's a pythonic way of creating a curried function?
Say I have a function that expects a function of one paramter, and I have a function of two parameters.
I'd like to bind one of the parameters of the second function so I can pass it to the first.
I can do that with a lambda expression and a default argument, but it seems a little unclean. |
| |
|
|
|
|
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
Peter Pitt, you want a curry
Or what you might call a partial call or partial invokation |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
Right.
But I imagine Python doesn't have a bind1st function.  |
| |
|
|
|
|