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 details)
Built Distribution
File details
Details for the file inclusive-0.0.2.tar.gz
.
File metadata
- Download URL: inclusive-0.0.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8786529c48d8a3427a2a555306ee6290b853305b54ae48de4d4aa27d7631e1c0 |
|
MD5 | fa4bb545642d8a60872436f8bf13777f |
|
BLAKE2b-256 | 0977e2c17577ec253a3d6a1e4c575e5fb2903c00e8388683724ec45d62c3f2ef |
File details
Details for the file inclusive-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: inclusive-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9c7558a0227617a5c69ed50f1c013309da94b4f242b10a3676e73a1f9965ab2 |
|
MD5 | 6b5c8246c285d42ea3a7b1b5ba27dfd4 |
|
BLAKE2b-256 | 5a79ec05b5c3c2b944eae3f34b23b3ab05d31a65597d18b154c206cff27ac8c1 |