Inheritance for iterable attributes.
Reason this release was yanked:
Wheel is missing the module
Project description
accumulate
Inheritance for iterable attributes.
accumulate
eases inheritance of iterable class attributes by accumulating values along the MRO, for example:
from accumulate import accumulate
class Base:
fields = ["id"]
metadata = {"read_only_field": ("id",)}
class User(Base):
fields = accumulate(["name", "password"])
metadata = accumulate(
{
"filter_fields": ("name",),
"hidden_fields": ("password",),
}
)
assert User.fields == ["id", "name", "password"]
assert User.metadata == {
"filter_fields": ("name",),
"hidden_fields": ("password",),
"read_only_field": ("id",),
}
Installation
Install using pip install -U accumulate
.
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
accumulate-2.0.0.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for accumulate-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07279256f68dac0ca20ec8948461588e65a99a05a81deb644836d5559af2430c |
|
MD5 | 114a1e3653a966d011471d406677bcac |
|
BLAKE2b-256 | 0e23fcd6c4a4deac1537af3e62e65d1b3c036ffa57129faa763e8f1d8dcb10cb |