Creates slice objects with clean syntax.
Project description
make-slice
Creates slice objects with clean syntax.
Install
pip install make-slice
Usage
from make_slice import make_slice
my_list = list(range(5)) # list: [0, 1, 2, 3, 4]
# Create a slice object
rev_slice = make_slice[::-1] # Equivalent to slice(None, None, -1)
# Use the slice object
print(my_list[rev_slice]) # Output: [4, 3, 2, 1, 0]
Development
use poetry to manage dependencies and virtual environments:
pip install poetry
poetry install
use pre-commit to run reformatting and linting:
pre-commit install
pre-commit autoupdate
pre-commit run --all-files
License
MIT License - See LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
make_slice-0.3.0.tar.gz
(2.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
File details
Details for the file make_slice-0.3.0.tar.gz.
File metadata
- Download URL: make_slice-0.3.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.11.0-1014-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7072bbe1027be79e24723d7f8439748f436c0415565c0fef69303c8909ef55ba
|
|
| MD5 |
9060462cfc414d5b211f1c3cba81424b
|
|
| BLAKE2b-256 |
0399222a2815610a5f90b5322d92f83b8dda7ad30a0762c8e357ab0153ed0c33
|
File details
Details for the file make_slice-0.3.0-py3-none-any.whl.
File metadata
- Download URL: make_slice-0.3.0-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.11.0-1014-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e490dc6a13010f3e4df13ddd7b94d5f42c74f06537ee2d3b52503fba21943afc
|
|
| MD5 |
e15b8c19c19187b87b4baa38e8d176d4
|
|
| BLAKE2b-256 |
4c2ef87610b2c7276827d5999fe22bee0adfea836bbdc819912d5161f2f9e142
|