Skip to main content

Providing some additional capabilities on top of itertools.

Project description

ben42code.myitertools

Providing some additional capabilities on top of itertools.

ben42code.myitertools.islice_extended

islice_extended is an extended version of itertools.islice that does support negative start/stop indexes and negative step for inputs.

from ben42code.myitertools import islice_extended

input = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
result = list(islice_extended(input, -1, -5, -1))
print(f"Result: {result}")

exit()

Ouput:

Result: [9, 8, 7, 6]

ben42code.myitertools.IteratorCounter

Just a wrapper for iterator/iterable to keep track of the iterated elements count.

wrapper = IteratorCounter('ABCDEFGHIJKLMNOP')
result = list(islice(wrapper, 2, 5))
print(f"Result: {result}")
print(f"IteratorCounter.count: {wrapper.count}")

exit()

Ouput:

Result: ['C', 'D', 'E']
IteratorCounter.count: 5

PyPI Downloads PyPI - Downloads

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

ben42code_myitertools-0.0.6rc4.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ben42code_myitertools-0.0.6rc4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file ben42code_myitertools-0.0.6rc4.tar.gz.

File metadata

  • Download URL: ben42code_myitertools-0.0.6rc4.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ben42code_myitertools-0.0.6rc4.tar.gz
Algorithm Hash digest
SHA256 20cc995379789d4b55b0add1aa2d6e16f2993795c5f535006d76d3cf709cad51
MD5 3eb8950d09794c039b1153e4a4701235
BLAKE2b-256 cfe5b0c6fe8f7ec286627c7de50403480438cd468a73b0b88e5f42ff3d69f3be

See more details on using hashes here.

Provenance

The following attestation bundles were made for ben42code_myitertools-0.0.6rc4.tar.gz:

Publisher: release.yml on ben42code/myitertools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ben42code_myitertools-0.0.6rc4-py3-none-any.whl.

File metadata

File hashes

Hashes for ben42code_myitertools-0.0.6rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 bac57c1c825bec981d262531a1bf243dbe4e73b6cc9b6d47d2a732b430e14ab1
MD5 e23fc2c3bc15f77c54490bfe8837aaa0
BLAKE2b-256 03826c643a007416a9ce61ed99cd47fbf88d5bfe6d8a575457c5d7fa7299b5b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ben42code_myitertools-0.0.6rc4-py3-none-any.whl:

Publisher: release.yml on ben42code/myitertools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page