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?
- Default
iota._countervalue equals to-1. A = iota()-iota.__new__()incrementsiota._counterand returns it.- It is possible to reset
iota._countercallingiota()withinwith iota.start(): ...block.
2.1. You can also provide a number to start from. For example:D,EandFfrom example above will be equal to10,11, and12accrordingly.
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)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|