minmax(x): min(x), max(x) in one pass
Project description
pyminmax
minmax(x)
is equivalent to (min(x), max(x))
, except that it requires
only one pass through the argument(s), as opposed to two. It is written in C,
adapted straight from CPython's implementation of min()
and max()
.
Installation
pip install pyminmax
Usage
>>> from pyminmax import minmax
>>> minmax([5, 2, 0, 100, -100, 10])
(-100, 100)
Test
Once installed, run the test suite via
python -m unittest pyminmax.tests --verbose
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
pyminmax-0.1.0.post63.tar.gz
(5.9 kB
view details)
File details
Details for the file pyminmax-0.1.0.post63.tar.gz
.
File metadata
- Download URL: pyminmax-0.1.0.post63.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7d62bb5fc59c56c2b7f41c1d6caed5324eb5fff3c853e558bdaf1897cdbc6f7 |
|
MD5 | 7a2afc05ce84a8832f84c4d3b93b6db4 |
|
BLAKE2b-256 | 4285cde4b7aa41a812fe4320e339a71ae456b12fe1242badb2c9179922092b78 |