No frills function composition
Project description
Important If you prefer to write Python code in a more functional style you may find the toolz package to be more useful, it includes a compose function as well as several functions conducive to writing functional code in Python.
No magic operators or special objects just a function with unit tests. Here is a wonderfully contrived example to whet your appetite:
>>> import json
>>> from compose import compose
>>> from operator import itemgetter
>>> compose((3).__mul__, next, iter, itemgetter('b'), json.loads)('{"a": 1, "b": [2, 3]}')
6
Contribute
See http://github.com/jonathanj/compose for development.
Installation
$ pip install compose-func
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
compose-func-1.0.1.tar.gz
(1.7 kB
view details)
Built Distribution
File details
Details for the file compose-func-1.0.1.tar.gz
.
File metadata
- Download URL: compose-func-1.0.1.tar.gz
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0d46485c826d3a7a1d589d492c42786aa975e5035abceeb478dcf540535741d |
|
MD5 | a0c7b00913130ae5ecca4ee90dbd791f |
|
BLAKE2b-256 | 4b8fcbd1f8570d2a552409656d748fd2bb68151e87504c89c733d64e44e59e30 |
File details
Details for the file compose_func-1.0.1-py2-none-any.whl
.
File metadata
- Download URL: compose_func-1.0.1-py2-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68e0c64687b3d5afe2b3c094de5565d6d0aa93f2106023769ba56a8f5c430725 |
|
MD5 | 96a3b826fb1e6ba3988c442f1d2425e1 |
|
BLAKE2b-256 | 8339a789c2e1a1bf79ae5f993ff047b550cbc3a31a844ed4ab21ebcaa95b8ce7 |