Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

florimondmanca/dataclasses-properties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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: