[Python-Dev] Making mutable objects readonly

Mark Hammond MarkH@ActiveState.com
2001年1月31日 23:18:12 +1100


MAL writes:
> > - How to spell it? x.freeze()? x.readonly()?
>> How about .lock() and .unlock() ?

I'm with Greg here - lock() and unlock() imply an operation similar to
threading.Lock() - ie, exclusivity rather than immutability.
I don't have a strong opinion on the other names, but definately prefer any
of the others over lock() for this operation.
Mark.

AltStyle によって変換されたページ (->オリジナル) /