Skip to main content

PyIota - Simple Go lang iota pattern implementation

Simple Usage

from pyiota import iota

with iota.start():
  A = iota()
  B = iota()
  C = iota()
with iota.start(10):
  D = iota()
  E = iota()
  F = iota()
print(A, B, C, D, E, F) #=> '0 1 2 10 11 12'

How it works?

  1. Default iota._counter value equals to -1.
  2. A = iota() - iota.__new__() increments iota._counter and returns it.
  3. It is possible to reset iota._counter calling iota() within with iota.start(): ... block.
    2.1. You can also provide a number to start from. For example: D, E and F from example above will be equal to 10, 11, and 12 accrordingly.

Release files for pyiota 1.2.1

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

Built distribution (wheel)

Table of built distributions (wheels) for pyiota 1.2.1
File Interpreter ABI Platform
pyiota-1.2.1-py3-none-any.whl Python 3 none any Details

Release files / pyiota-1.2.1-py3-none-any.whl

Download URL pyiota-1.2.1-py3-none-any.whl
Size 2.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a1166c23344ca07e55d44e7b4a79052f8b26768d6de6eee26e0a129bc830010
BLAKE2b-256 checksum
How to use checksums
d177dd52cbcb6d46f9da0fc4ef8d5955aa5ed6f715f5017ab12e61049ac19f50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.63.0 importlib-metadata/5.0.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.8

Release history Release notifications | RSS feed

This release

1.2.1 This release

1 release file

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