Skip to main content

This package provides 2 iterators, enumerate_skip and enumerate_manual, that extend the behaviour of the standard libraries enumerate a bit.

enumerate_skip has been extended with a skip method that makes sure the next index yielded is the same as the current one. The word skip might not make sense at first, but this function was written because I needed to not handle some values yielded by an iterator, like:

for index, obj in enumerate(...):
    if obj.has_some_attr():
        continue
    # do something with object and index here

If index in that example was printed to the user (or something similar), there would be gaps. Using enumerate_skip instead, the above example could be written as:

it = enumerate_skip(...)
for index, obj in it:
    if obj.has_some_attr():
        it.skip()
        continue
    # do something with object and index here

enumerate_manual works the other way around: you have to manually call advance on it to increment the index:

it = enumerate_manual(...)
for index, obj in it:
    if obj.has_some_attr():
        continue
    # do something with object and index here
    it.advance()

Release files for enumerate_skip 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enumerate_skip 1.0
File Size Uploaded
enumerate_skip-1.0.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for enumerate_skip 1.0
File Interpreter ABI Platform
enumerate_skip-1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 8.5 kB

Release files / enumerate_skip-1.0.tar.gz

Download URL enumerate_skip-1.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c1ad838c822720abe43371ff273ca0f09697850e380b55432bba6162f2c5a04c
BLAKE2b-256 checksum
How to use checksums
17f17dd0a1b56a859d7decf1fde685a76cea6fcc348c380f8f21d651d4a3c9e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / enumerate_skip-1.0-py2.py3-none-any.whl

Download URL enumerate_skip-1.0-py2.py3-none-any.whl
Size 4.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
32fca0f017027ca631b1195abbd4fa03d34929d32508170f15fa805bb02136c7
BLAKE2b-256 checksum
How to use checksums
ed4b731d4c8a99e01d1f0eb4faa8aeea39ac685b07f31bee1ef270f62ca7cbbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page