Class data: Getters, Setters & Properties

Data: fields vs properties Boilerplate Getters and Setters Cutting the boilerplate, and the impact Beyond the boilerplate for getters and setters Data: fields vs properties Classes have both functions called methods and instance data or  fields. Python also uses the term properties, for data that has an explicit getters function and optionally setter a setter… Continue reading Class data: Getters, Setters & Properties

Python dataclasses: A revolution

Python data classes are a new feature in Python 3.7, which is currently in Beta 4 and scheduled for final release in June 2018.  However, a simple pip install brings a backport to Python 3.6.  The name dataclass sounds like this feature is specifically for classes with data and no methods, but in reality, just… Continue reading Python dataclasses: A revolution

Python Class vs Instance Variables

Python class variables offer a key tool for building libraries with DSL type syntax, as well as data shared between all instances of the class. This page explains how Python class variables work and gives some examples of usage. Class & Instance Variables Instances vs the class object Instance Variables Class Variables Using Class and… Continue reading Python Class vs Instance Variables