Popular recipes by arnoques http://code.activestate.com/recipes/users/4180947/2012-02-16T21:39:02-08:00ActiveState Code RecipesRestricted dictionary (Python) 2012-02-16T21:39:02-08:00arnoqueshttp://code.activestate.com/recipes/users/4180947/http://code.activestate.com/recipes/578042-restricted-dictionary/ <p style="color: grey"> Python recipe 578042 by <a href="/recipes/users/4180947/">arnoques</a> (<a href="/recipes/tags/datastructures/">datastructures</a>, <a href="/recipes/tags/dict/">dict</a>, <a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/record/">record</a>). </p> <p>It's a dictionary that's restricted to a tuple of allowed keys. Any attempt to set an invalid key raises an error.</p>