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]
Documentation
Online Documentation is available at 0x00-pl.github.io/make_slice.
Local server Documentation can be started using mkdocs:
mkdocs serve # Serves the Documentation at localhost:8000 by default.
Offline Documentation can be built using mkdocs:
mkdocs build # Generates static Documentation files in the 'site' directory.
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
If you got files were modified by this hook when running git commit,
you can run git add . to stage the changes and then commit again.
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
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.4.0.tar.gz.
File metadata
- Download URL: make_slice-0.4.0.tar.gz
- Upload date:
- Size: 2.6 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 |
dee113e5208c4c62488e4be7d6dbe27bc3d23071e401dcac42d067076ace84fe
|
|
| MD5 |
b4640669522d4e5c0b8b7b789144d5e3
|
|
| BLAKE2b-256 |
5b537b28b96089c4a8870c38d65f31e7aae09de4f6e9c1d0aaecd90c49f806ad
|
File details
Details for the file make_slice-0.4.0-py3-none-any.whl.
File metadata
- Download URL: make_slice-0.4.0-py3-none-any.whl
- Upload date:
- Size: 2.8 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 |
a8c64c907ac9c6267282927c80c2ce44ff737ef0e612b8825a28b23aea9e1fee
|
|
| MD5 |
ef613ebf561fcbbb7ca475f8e9543942
|
|
| BLAKE2b-256 |
e171bd83f3d4cab7b3599d925e6639150e705aff7ce0f0061699f60ad069535f
|