Python by Structure: Property Decorators and Managed Attributes
Timothy was adding a Rectangle class to a geometry library when he ran into a design problem. "Margaret, I need an area attribute on my rectangles, but the area depends on width and height. Should I calculate it in __init__ and store it, or make user...
aaron-rose.hashnode.dev6 min read