IterTypes Library
This library has some useful types and functions used to get types of iterables. Whilst iterable types were purposely avoided by the types library, iterables offer unique types which could sometimes be useful to obtain.
Getting started
Start by importing the module:
import itertypes
There are various functions which follow the naming convention is[type]iterator.
itertypes.isstringiterator(iter("string"))
>>> True
dictionary = {1: 2, 3: 4}
iteration = iter(dictionary.items())
itertypes.isdictitemiterator(iteration)
>>> True
There's also the itertypes.isiterator function where it checks if the given
object is iterable or not.
my_variable = 5
itertypes.isiterable(my_variable)
>>> False
my_variable = ['a', 'b', 'c', 'd']
all([itertypes.isiterable(my_variable), itertypes.islistiterator(iter(my_variable))])
>>> True
Finally, there's various types which resolve to iterable types. These types can be used with isinstance, or with the equality operator and the type function.
byte = bytearray()
isinstance(iter(byte), itertypes.BytearrayIteratorType)
>>> True
iterable = iter({1: 2, 3: 4}.values())
isinstance(iterable, itertypes.DictValueIteratorType)
>>> True
Installation
Install through pip.
python -m pip install itertypes
Metadata
Release files for itertypes 1.6.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 | Actions |
|---|---|---|---|---|
| itertypes-1.6.1.tar.gz | 4.4 kB | Without provenance | Details for itertypes-1.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| itertypes-1.6.1-py3-none-any.whl | Python 3 | none | any | Details for itertypes-1.6.1-py3-none-any.whl |
Total release size: 11.1 kB
Release files / itertypes-1.6.1.tar.gz
| Download URL | itertypes-1.6.1.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
070423b0ae16bb7e6ada867994af7f6cac8e3d2a8626e11acdf58415c7f502ea
|
|
BLAKE2b-256 checksum How to use checksums |
3d0e66df40d7e5bd260cc2c6f1f99685945eb45566bccc7e4fc89203de45a697
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5
|
Release files / itertypes-1.6.1-py3-none-any.whl
| Download URL | itertypes-1.6.1-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7069f572b0f0328500577489cbfdf77f63a486508fb6523c8e662f5d43eb05f5
|
|
BLAKE2b-256 checksum How to use checksums |
b8780463c4d0cec51fb9c11d5acb147f996842546cd5c92a5b0f107aeb64852b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5
|
Security for itertypes 1.6.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.