Listr is python module that can be used to:
- iterate list through pointer/cursor
current(),next(),prev(),start(),end(). - iterate list through
iter()(without looping/queue-like)
installation
pip install listr
Example
# -*- coding: utf-8 -*-
from listr import Listr
import unittest
class ListrTest(unittest.TestCase):
def test_pointer(self):
t = Listr()
t.import_list(["one","two","three"])
self.assertEqual(t.current(), "one")
self.assertEqual(t.next(), "two")
self.assertEqual(t.next(), "three")
self.assertEqual(t.next(), "one")
self.assertEqual(t.prev(), "three")
self.assertEqual(t.start(), "one")
self.assertEqual(t.end(), "three")
def test_iterator(self):
t = Listr()
t.import_list(range(1,10))
for i in t.list:
self.assertEqual(i,t.iter())
self.assertEqual(t.iter_check(), False)
t.iter_reset()
self.assertEqual(t.iter_num, 0)
if __name__=="__main__":
unittest.main()
Hint
- you can access list through
Listr.listproperty/attribute. iter()can be access with python native iterator (Listr object is iterable).
Metadata
Release files for listr 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| listr-1.0.1.tar.gz | 14.4 kB | Without provenance | Details |
Release files / listr-1.0.1.tar.gz
| Download URL | listr-1.0.1.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6f0219f91b1f79d0b859ee0f2872b58befa66288eac5dc511eb788e6c430b76
|
|
BLAKE2b-256 checksum How to use checksums |
ea2bbd5b0fcd78d0d7ebc24893fd8897b9e133f3ee02a45ff6d17b38ddc6d3bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Security for listr 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.