Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; ':-)': 0.06; 'attribute': 0.07; 'python': 0.08; 'content-type:multipart/signed': 0.09; 'dict': 0.09; 'filename:fname piece:signature': 0.09; 'immutable': 0.09; 'tuple': 0.09; 'btw)': 0.16; 'builtins.': 0.16; 'content- type:application/pgp-signature': 0.16; 'filename:fname piece:asc': 0.16; 'filename:fname:signature.asc': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; 'computing': 0.18; 'header:In-Reply-To:1': 0.22; 'object,': 0.24; 'cc:2**0': 0.26; 'import': 0.27; 'cc:addr:python.org': 0.29; 'hash': 0.30; 'outer': 0.30; "i've": 0.32; 'there': 0.33; 'header:User-Agent:1': 0.33; 'it.': 0.33; 'too': 0.33; 'object': 0.33; 'anything': 0.34; 'sets': 0.35; 'question': 0.36; 'own,': 0.37; 'but': 0.37; 'another': 0.37; 'either': 0.37; 'received:128': 0.38; 'enough': 0.38; 'received:192': 0.38; 'useful': 0.38; 'should': 0.38; 'put': 0.40; 'one,': 0.40; 'nathan': 0.84; 'excluded': 0.91; 'items,': 0.91; 'spell': 0.91 Date: Wed, 08 Feb 2012 23:33:23 -0600 From: Evan Driscoll User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Nathan Rice Subject: Re: Re: frozendict References: <4F332007.9080800@wisc.edu> In-Reply-To: X-Enigmail-Version: 1.3.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig435F04160C16E69E2CD39A02" Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 50 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328765635 news.xs4all.nl 6886 [2001:888:2000:d::a6]:52876 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20055 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig435F04160C16E69E2CD39A02 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 13:59, Nathan Rice wrote: >> Turn the question around: why should there be? >> Python is intentionally parsimonious in adding builtins. >=20 > For the same reason there are frozensets? >=20 > I put dicts in sets all the time. I just tuple the items, but that > means you have to re-dict it on the way out to do anything useful with > it. I am too lazy to write a frozendict or import one, but I would > use it if it was a builtin. I've wanted to do that as well. My current use case is I want to have a dict as an attribute of another object, and I want to use that object as a key in a dictionary. That means that the outer object has to be immutable (an obnoxious enough task on its own, BTW) and that either the dict itself has to be excluded from computing the hash or the dict also has to be immutable. Also, it's not like it has to be a builtin, per se. I know how to spell 'import'. :-) Evan --------------enig435F04160C16E69E2CD39A02 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJPM1qpAAoJEAOzoR8eZTzg5AoH/3hfqBWeZRsSSRXE+BwpREaZ sK1cf13x3s2rm2LtNaZw4YNolK2n+uDXgbs+Gv/AsgAnO2e5+d+5//I0G+amqa8K cmsTGcxX1gJG3vBwHY9hndZnjl5hzqa59DJomGVRnGkEzTmNfvk6VF+j6LKd5PiW tMkYk//dotzxgrnDHEo+mI9pbCfl2iJhuvU76HXz6oXIkXFQa9gwJWvzXrUTL3rp qHLU+hNpWRSy8jYUWUcBBruQGUnrIqCnOoUXihO580CjRFXA3VcVa4zg/Mv2eRLh QRb3DY9eW/vjS5ku6ee4OeqflrCY+ZGlMf8HwYU4iYoy0Uh7NLyrqqSftLoioAk= =kI5e -----END PGP SIGNATURE----- --------------enig435F04160C16E69E2CD39A02--