Skip to main content

Lazy evaluation of dataclass fields

Project description

zincware PyPI version Coverage Status

znfields

Provide a getter for dataclasses.fields to allow e.g. for lazy evaluation.

pip install znfields

Example

import dataclasses
import znfields

def example1_parameter_getter(self, name):
    return f"{name}:{self.__dict__[name]}"

@dataclasses.dataclass
class Example3(znfields.Base):
    parameter: float = znfields.field(getter=example1_parameter_getter)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

znfields-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

znfields-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file znfields-0.1.1.tar.gz.

File metadata

  • Download URL: znfields-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure

File hashes

Hashes for znfields-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5ccd6e01a1dbb9bb63a90e48128b2bd5c4bd76955a9b8888918c2239a9be4b44
MD5 ade68e62b6264e654989fd1d284a4735
BLAKE2b-256 329fb112361e7faaf21f416cf5d8ff67f45873d3b9918f987c6b1654739f47ff

See more details on using hashes here.

File details

Details for the file znfields-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: znfields-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure

File hashes

Hashes for znfields-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7458e384254bcb43faf74542790c07502a02bd0bab72476a806c6cf6e01f39e1
MD5 51faca865e54dc67162e017f0061be67
BLAKE2b-256 23ed3a300ea885fe9a4437bb9d575d4bf38e08a8d54720359a7b723f3f10014e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page