Pot: Class properties
As most programmers, I’ve been trained with the getter/setter idiom. It allows a programmer in any object-oriented programming language to create a class interface which makes sure that only valid data is written. An example of a class with getter/setter in Python: class Person1(object): def __init__(self): self._age = None def get_age(self): return self._age def set_age(self, age): self._age = age We just wrote two methods - four lines - only to be able to modify and access some data. And we have to do that for every property. This is such a common idiom, that IDEs even have wizards for that. ...