frozendict

E

Evan Driscoll

Hi all,

I've been trying for a few days (only a little bit at a time) to come up
with a way of implementing a frozendict that doesn't suck. I'm gradually
converging to a solution, but I can't help but think that there's some
subtlety that I'm probably missing which is why it's not already provided.

Does anyone know why Python doesn't already come with a frozendict, or
why there seem to only be a couple attempts to write one?

Evan



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPMyAMAAoJEAOzoR8eZTzg3xcH/2buF+pkuLRdt2buhMLK/iy8
nweAjxn8VrDVy4qLQB+hkOFpKneyHbPD2HAVRPEoJevCCZwFOGrChdfNDKLt4s5m
/bde+mUqCdgu++9Y3iY21iIFdDHc2qzAmzPt0dhaDzp6v+VA0m3MXeILjyHzcJRS
KquY3soNk1JmqsNPLi4VFFNrNhgbVHcm67NTViReaEM58aWTy0mJBV7X9a6sWWR5
78URnlPmkamKbeqGV9559wgSAKsxRgMs83nvQrB6F9Uz360MFA2s+A6T1bTdpTwI
JrvsdfUzwp0cYGipwIfmw4X76wAzf3I2KJwyjz7iEFyd1t1ITvbMW4LqC5j3YYQ=
=uQ6H
-----END PGP SIGNATURE-----
 
S

Steven D'Aprano

Hi all,

I've been trying for a few days (only a little bit at a time) to come up
with a way of implementing a frozendict that doesn't suck. I'm gradually
converging to a solution, but I can't help but think that there's some
subtlety that I'm probably missing which is why it's not already
provided.

Does anyone know why Python doesn't already come with a frozendict, or
why there seem to only be a couple attempts to write one?

Because there is no way to implement one that doesn't suck?

Because it's a solution in search of a problem?

<shrug>

Actually, that's unfair. A write-once dict would be awesome for providing
read-only constants, if only there were some way to set a namespace to
using non-builtin dicts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top