ethereum / eth-utils

Utility functions for working with ethereum related codebases.
https://eth-utils.readthedocs.io/en/latest/
MIT License
309 stars 148 forks source link

Import from the curried versions of toolz #136

Open carver opened 5 years ago

carver commented 5 years ago

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'
reedsa commented 10 months ago

@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.