On Thu, 01 Mar 2012 16:50:06 -0800, Guido van Rossum <guido at python.org> wrote: > On Thu, Mar 1, 2012 at 4:39 PM, Victor Stinner <victor.stinner at gmail.com> wrote: > > frozendict could be used to implement "read-only" types: it is not possible > > to add or remove an attribute or set an attribute value, but attribute value > > can be a mutable object. Example of an enum with my type_final.patch > > (attached to issue #14162). [...] > > I think you should provide stronger arguments in each case why the > data needs to be truly immutable or read-only, rather than just using > a convention or an "advisory" API (like __private can be circumvented > but clearly indicates intent to the reader). +1. Except in very limited circumstances (such as a security sandbox) I would *much* rather have the code I'm interacting with use advisory means rather than preventing me from being a consenting adult. (Having to name mangle by hand when someone has used a __ method is painful enough, thank you...good thing the need to do that doesn't dome up often (mostly only in unit tests)). --David
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