Steven D'Aprano wrote: > So in principle, we could have a mutable class, and a immutable one, and > when you flick the switch, the instance.__class__ changes from mutable > to frozen. That seems unfriendly to subclasses as well. To extend a class you now need to subclass both the mutable and immutable versions of the base class, ensure they share the behaviour they should have in common (possibly by using a third mixin class) and arrange for the freezing switch to install the immutable subclass instead of the base one. All of which seems like a huge amount of hassle just to save an instance attribute. And I don't even want to think what multiple inheritance would do to all this. -- Greg
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4