eth-utils
eth-utils copied to clipboard
Import from the curried versions of toolz
What was wrong?
eth_utils.toolz does not provide access to the curried versions of the methods
How can it be fixed?
Add another eth_utils.curried.toolz module like the eth_utils.toolz one, but importing from toolz.curried.*.
Add smoke tests for at least one method from each subsection of https://toolz.readthedocs.io/en/latest/api.html -- like:
from eth_utils.curried.toolz import drop
drop2 = drop(2)
assert list(drop2([4, 3, 2, 1])) == [2, 1]
Should also smoke test that non-curryable functions are working, like:
from eth_utils.curried.toolz import compose
hexint = compose(hex, int)
assert hexint('10') == '0xa'
@fselmo @pacrob looks like above mentioned eth_utils.curried.toolz as the namespace but it seems backwards. Should we instead implement eth_utils.toolz.curried, to match that of tools.curried?
Once the decision is made I'll go ahead and knock this out.