[Python-il] Interim summary (was: Re: The Tuples and Lists question)
Oren Tirosh
orent at hishome.net
Wed Jun 11 19:02:46 IDT 2008
On Wed, Jun 11, 2008 at 6:33 PM, Omer Zak <w1 at zak.co.il> wrote:
> 1. It would be nice to have an immutable Dict data type, which can be
> used as Dict key.
Funny you should mention that...
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/414283
I wrote this recipe a few years ago. I don't expect it to be made into
a builtin, though. The use case is not that common.
> 2. It may be nice to explore the concept of different kinds of
> references to the same object. While mutable-expecting references vs.
> immutable-expecting references are not useful concepts, the idea of
> different kinds of references may be an useful metaphor for controlling
> access to values in multi-threaded applications.
Python has made the deliberate choice to have types for objects but
not for references. The "consenting adults" principle means there is
no "controlling access" to things and thus no private modifier in
Python.
Oren
More information about the Python-il
mailing list