The KeyedDict object keeps a list of approved key values. If you try to assigned an unapproved key to a value, an exception is thrown.

When you create the object, ygned an unapproved key to a value, an exception is thrown.

When you create the object, you give it a sequence (tuple, list, etc.) of key objects and then, when you set an item with a key, it will make sure that the key is in the "approved" list. If you try to set an item with a key that isn’t in your approved list, you get an TypeError exception.


Download from: Homepage




Author:
admin
Time:
Tuesday, May 27th, 2008 at 4:12 pm
Category:
Programming Methods - Algorithms
Comments:
You can leave a response, or trackback from your own site.
RSS:
You can follow any responses to this entry through the RSS 2.0 feed.
Navigation:

Leave a Reply