Dataclass properties in Python
This is the supporting repository for "Reconciling Dataclasses And Properties In Python", a blog post published on my blog and (soon) dev.to.
The various Python files here are the attempts presented in the blog post to implement properties on dataclasses β which is not an intuitive task.
Usage
To run an interpreter using any of the attempts, you can make use of Python's -i
command line argument, which starts a shell after running a script:
$ python -i 3_field.py
>>> # Start doing things with `Vehicle`!
Resources
Official documentation on dataclasses and features used in the blog post: