pytoolz / toolz

A functional standard library for Python.
http://toolz.readthedocs.org/
Other
4.68k stars 261 forks source link

Keep currying through compose #273

Open mbertheau opened 9 years ago

mbertheau commented 9 years ago

Composing a curried function with removes the currying. It can easily be re-added by re-applying curry, but maybe that should happen automatically.

LeuschkeTressa commented 1 year ago

This issue was opened 7 years ago.

If there was a problem, it's probably fixed. This runs without errors:

@curry
def f(x: int, y: int) -> int:
    return x + y

def test_curry() -> None:
    assert f(1, 2) == 3
    assert f(1)(2) == 3

def test_pipe_curried() -> None:
    assert pipe(1, f(2)) == 3
    assert pipe(1, f(2), f(3)) == 6

def test_compose_curried() -> None:
    assert compose(f(2), f(3))(1) == 6