Python
Descriptors: The Machinery Behind Attributes
A descriptor is an object that controls what happens when an attribute is read, written or deleted. property, methods, classmethod and staticmethod ar...
The descriptor protocol behind attributes, and dataclasses for data carrying classes.
2 notes
A descriptor is an object that controls what happens when an attribute is read, written or deleted. property, methods, classmethod and staticmethod ar...
A dataclass generates __init__, __repr__ and __eq__ from field declarations. It removes the boilerplate from every class whose main job is holding dat...