A collection of some helper functions
Project description
python-trick
一些helper函数合集。
Reference
compose
def add_ten(x: int) -> int:
return x + 10
def multi_five(x: int) -> int:
return x * 5
add_ten_then_multi_five = compose(multi_five, add_ten)
add_ten_then_multi_five(2) # output: 60
curry
@curry
def add(a, b, c, d):
return a + b + c + d
assert add(1, 2, 3, 4) == add(1)(2)(3)(4)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
trick-0.1.0.tar.gz
(3.3 kB
view hashes)
Built Distribution
trick-0.1.0-py3-none-any.whl
(3.0 kB
view hashes)