Inclusive range and slice
Project description
inclusive
Provides range and slice with inclusive right boundary.
Examples for range:
from inclusive import range
list(range(5)) == [0, 1, 2, 3, 4]
list(range[5]) == [1, 2, 3, 4, 5]
list(range(2, 7)) == [2, 3, 4, 5, 6]
list(range[2, 7]) == [2, 3, 4, 5, 6, 7]
list(range(2, 11, 3)) == [2, 5, 8]
list(range[2, 11, 3]) == [2, 5, 8, 11]
Examples for slice:
from inclusive import slice
list(range(100)[slice(5)]) == [0, 1, 2, 3, 4]
list(range(100)[slice[5]]) == [1, 2, 3, 4, 5]
list(range(100)[slice(2, 7)]) == [2, 3, 4, 5, 6]
list(range(100)[slice[2, 7]]) == [2, 3, 4, 5, 6, 7]
list(range(100)[slice(2, 11, 3)]) == [2, 5, 8]
list(range(100)[slice[2, 11, 3]]) == [2, 5, 8, 11]
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
inclusive-0.0.2.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for inclusive-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9c7558a0227617a5c69ed50f1c013309da94b4f242b10a3676e73a1f9965ab2 |
|
MD5 | 6b5c8246c285d42ea3a7b1b5ba27dfd4 |
|
BLAKE2b-256 | 5a79ec05b5c3c2b944eae3f34b23b3ab05d31a65597d18b154c206cff27ac8c1 |