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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
trick-0.1.0-py3-none-any.whl
(3.0 kB
view details)
File details
Details for the file trick-0.1.0.tar.gz.
File metadata
- Download URL: trick-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2fdb185f2529c88e20d834efc57bdfa06d75c43e8947c5e1730a4d639d2ed87
|
|
| MD5 |
a73e4fc21b2f76b8a209f57e603ec9b2
|
|
| BLAKE2b-256 |
0834820bfaa89bd77a523dace3db999ec02ecda283bb90fef95239f0491c9f61
|
File details
Details for the file trick-0.1.0-py3-none-any.whl.
File metadata
- Download URL: trick-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f549fae5b544cc304a48b65ff5d51f86cdf6691d1ae4b71ef2cca3346db01de
|
|
| MD5 |
22945dcf61ab02fbb6bf3cfb77bfcdda
|
|
| BLAKE2b-256 |
fcf26e02dfdd4e7960746d8b374cfcd5deeda8c05bbe8563e05f5286efcdd1af
|