I love enumerate(), but I hate using it with zip() - this function takes care of it
pip install enummi
Tested against Windows 10 / Python 3.10 / Anaconda
Combining multiple iterables:
It allows you to merge multiple iterables into a single sequence of tuples. This can be useful when you have several related iterables and want to process them together.
Indexing the tuples:
The function assigns an index value to each tuple, representing the position of the elements in the original iterables. This indexing provides a convenient way to access and reference elements based on their relative positions.
Generates results on the fly:
As a generator function, enummi generates and yields results one at a time, as they are needed. This lazy evaluation strategy can save memory and computational resources, especially when dealing with large or infinite sequences.
Flexibility with input:
The function accepts a variable number of iterables as arguments (*args), allowing you to provide any number of iterables to be combined. It can handle different lengths of input iterables and adapt accordingly.
Compatible with different iterable types:
The function can work with various types of iterables, such as lists, tuples, strings, or any other iterable object. It is not limited to a specific data structure, providing flexibility in terms of input.
Simple and concise implementation:
The implementation of enummi is relatively straightforward and concise, utilizing built-in Python functions (zip and enumerate) to achieve the desired functionality. This simplicity makes the function easy to understand and maintain.
from enummi import enummi
for i, a, b, c in enummi([1, 2, 3], [4, 5, 6], [7, 8, 9]):
print(i, a, b, c)
Output:
0 1 4 7
1 2 5 8
2 3 6 9
for i, a in enummi([1, 2, 3]):
print(i, a)
Output:
0 1
1 2
2 3
for i, a in enummi([]):
print(i, a)
Output:
(no output)
Metadata
Release files for enummi 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| enummi-0.10.tar.gz | 3.7 kB | Without provenance | Details for enummi-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| enummi-0.10-py3-none-any.whl | Python 3 | none | any | Details for enummi-0.10-py3-none-any.whl |
Total release size: 8.6 kB
Release files / enummi-0.10.tar.gz
| Download URL | enummi-0.10.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fabfff8c8529e07feb3fc781e84287e9213cba68e6f00ff6616e1c50046e2a5
|
|
BLAKE2b-256 checksum How to use checksums |
b953c2e7c9e8f1a0fbfc82d72377f5c5b9eb97ef47bca65c6d094dc73a199366
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / enummi-0.10-py3-none-any.whl
| Download URL | enummi-0.10-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba7386c1e0a2dbe54c59bbd4c281e7f74d3217778e3ab2784643165879e19e99
|
|
BLAKE2b-256 checksum How to use checksums |
e9b2c6917a0209d4a38ebe64c335f4b748ece6d912e78c6d36b46b5fd4ad9f97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for enummi 0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.