[Python-Dev] Add a frozendict builtin type

Yury Selivanov yselivanov.ml at gmail.com
Thu Mar 1 13:37:28 CET 2012


Actually I find fronzendict concept quite useful.  We also have an
implementation in our framework, and we use it, for instance, in
http request object, for parsed arguments and parsed forms, which
values shouldn't be ever modified once parsed.

Of course everybody can live without it, but given the fact of how
easy it is to implement it I think its OK to have it.

+1.

On 2012-02-29, at 8:45 PM, Raymond Hettinger wrote:

> 
> On Feb 29, 2012, at 4:23 PM, Victor Stinner wrote:
> 
>> One of my colleagues implemented recently its own frozendict class
>> (which the "frozendict" name ;-)
> 
> I write new collection classes all the time.
> That doesn't mean they warrant inclusion in the library or builtins.
> There is a use case for ListenableSets and ListenableDicts -- do we
> need them in the library?  I think not.  How about case insensitive variants?
> I think not.  There are tons of recipes on ASPN and on PyPI.  
> That doesn't make them worth adding in to the core group of types.
> 
> As core developers, we need to place some value on language 
> compactness and learnability.  The language has already gotten
> unnecessarily fat -- it is the rare Python programmer who knows
> set operations on dict views, new-style formatting, abstract base classes,
> contextlib/functools/itertools, how the with-statement works, 
> how super() works, what properties/staticmethods/classmethods are for,
> differences between new and old-style classes, Exception versus BaseException,
> weakreferences, __slots__, chained exceptions, etc.
> 
> If we were to add another collections type, it would need to be something
> that powerfully adds to the expressivity of the language.  Minor variants 
> on what we already have just makes that language harder to learn and remember
> but not providing much of a payoff in return.
> 
> 
> Raymond
> 
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/yselivanov.ml%40gmail.com



More information about the Python-Dev mailing list