Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Lycanthrope
on June 13, 2011
|
parent
|
context
|
favorite
| on:
Python idioms
There is functools.partial:
from functools import partial def add(x,y): return x+y add3 = partial(add, 3) add3(2) # returns 5
skimbrel
on June 13, 2011
[–]
Ah! I didn't know about that. It'd be nice to have the syntactic sugar à la Haskell, but oh well. Close enough.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: