How to make a Python subclass control the data stored in an immutable instance?
How do I give a Python subclass control over the data stored in an immutable instance? First, understand the new() method in Python. When subclassing an immutable type, override the new() method instead of the init() method. The new method…