[Python-Dev] Add a frozendict builtin type

Raymond Hettinger raymond.hettinger at gmail.com
Thu Mar 1 02:45:06 CET 2012


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120229/933385ff/attachment.html>


More information about the Python-Dev mailing list