A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-January/012314.html below:

[Python-Dev] Making mutable objects readonly

[Python-Dev] Making mutable objects readonly [Python-Dev] Making mutable objects readonlyTim Peters tim.one@home.com
Mon, 29 Jan 2001 21:57:59 -0500
[Guido]
> Yes, this is a good thing.  Easy to do on lists and dicts.  Questions:
>
> - How to spell it?  x.freeze()?  x.readonly()?

See below.

> - Should this reversible?

Of course.  Or x.freeze(solid=1) to default to permanent rigidity, but not
require it.

>  I.e. should there be an x.unfreeze()?

That conveniently answers the first question, since x.unreadonly() reads
horribly <wink>.

> - Should we support something like this for instances too?  Sometimes
>   it might be cool to be able to freeze changing attribute values...

"Should be" supported for every mutable object.  Next step:  as in endless
C++ debates, endless Python debates about "representation freeze" vs
"logical freeze" ("well, yes, I'm changing this member, but it's just an
invisible cache so I *should* be able to tag the object as const anyway
..."; etc etc etc).

keep-it-simple-ly y'rs  - tim




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