Skip to main content

Simple Go lang iota pattern implementation

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pyiota-1.2.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file pyiota-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: pyiota-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pyiota-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a1166c23344ca07e55d44e7b4a79052f8b26768d6de6eee26e0a129bc830010
MD5 110eac4ad7556f1aa8d5ab635d323dfc
BLAKE2b-256 d177dd52cbcb6d46f9da0fc4ef8d5955aa5ed6f715f5017ab12e61049ac19f50

See more details on using hashes here.

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