[ESR] > For different reasons, I'd like to be able to set a constant flag on a > object instance. Simple semantics: if you try to assign to a > member or method, it throws an exception. > > Application? I have a large Python program that goes to a lot of effort > to build elaborate context structures in core. It would be nice to know > they can't be even inadvertently trashed without throwing an exception I > can watch for. Yes, this is a good thing. Easy to do on lists and dicts. Questions: - How to spell it? x.freeze()? x.readonly()? - Should this reversible? I.e. should there be an x.unfreeze()? - Should we support something like this for instances too? Sometimes it might be cool to be able to freeze changing attribute values... --Guido van Rossum (home page: http://www.python.org/~guido/)
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