Command line utilities for information about now
Project description
Iterable decorator
Create iterable classes using a class decorator.
Values added to an iterable class are sored in the class's self.args
attribute as a tuple
of whatever type you have provided.
Examples
from iterables import iterable
@iterable
class Items:
# You can type annotate your iterable like so:
item: str
# Note that this has no real effect on the generation of the iterable.
items = Items("Hello", "iterables!")
for item in items:
print(item)
>>> "Hello"
>>> "iterables!"
You can attach additional methods to an iterable as you would with a dataclass.
from iterables import iterable
@iterable
class Items:
item: str
@classmethod
def from_list(data: list[str]):
return cls(*data)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file iterables-decorator-0.1.0.tar.gz
.
File metadata
- Download URL: iterables-decorator-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 775f92f49f11236de4d0386e65646cd13fd06458a93a189d7eaede5b76727071 |
|
MD5 | 89abed90b4aba7e68f1a157fd92279c0 |
|
BLAKE2b-256 | c934b0cb002ca6ae3e6fffa45315bc20cb62a9b2f087b1da7e4af15a85150e4a |
File details
Details for the file iterables_decorator-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: iterables_decorator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fac3f1e3265b26aa668a1367f830e3d6c0754f783121fce7a18e8c6d336115c7 |
|
MD5 | be0d7317218eee1f98a3a276406180bb |
|
BLAKE2b-256 | ed8d31253dfaea7c371282241a043fc35100c377c5877bbe92e5845864672685 |