I have a class called LimitedDict which is a dictionary that limits the number of entries it can contain by deleting old entries when a new one is added. It currently inherits from Python's dict class. I now need the exact same class, only I want it to inherit from defaultdict so that it has default values. How can I do this without just copying and pasting code?I've thought of making it a wrapper, but that creates a lot of boilerplate code.
Write two versions of class with two different super classes without violating DRY?
python