Make Delegation Work in Python

1 · fast.ai · Aug. 6, 2019, 10:15 p.m.
The Delegation Problem Let’s look at a problem that all coders have faced; something that I call the delegation problem. To explain, I’ll use an example. Here’s an example class you might see in a content management system: class WebPage: def __init__(self, title, category="General", date=None, author="Jeremy"): self.title,self.category,self.author = title,category,author self.date = date or datetime.now() ... Then, you want to add a subclass for certain types o...