4 ms·
And in case anyone else wants such a function, it's available in the standard library as functools.partial: https://docs.python.org/2/library/functools.html htt
by riwsky 12y ago
And in case anyone else wants such a function, it's available in the standard library as functools.partial: https://docs.python.org/2/library/functools.html https://docs.python.org/2/library/functools.html
- TheLoneWolfling 12y agoEh, I don't like the one in functools. It allows overriding of variables previously defined, which personally causes more problems than it solves. (So `functools.partial(foo, b=3)(a=1, b=2)` doesn't throw an error, and is equivalent to calling `foo(a=1, b=2)`)