Dictionary Mixin / Framework

Category: Python - Education

This script makes it easy to provide a full dictionary interface to a class defining only a few mapping methods for getting, setting, deleting, and listing keys. Also, a function is provided to incorporate the mixin at runtime so that code for existing modules need not be modified.By usmodules nixin as a superclass, you are free to overwrite any of these methods with your own and not break the mixin. For instance, your class may already define the .get() method but not any of the iter functions. The reason for implementing the full dictionary interface is to maximize substitutability. Given code that was designed to work with a dictionary, an object of your class (with the mixin) can be substituted for the dictionary.Some modules like shelve implement a subset of the dictionary interface. If you want to substitute a persistent shelve for a dictionary in existing code, then its interface needs to be broadened to handle all of the dictionary methods. Date: 23 May, 2012


Dictionary Interface - Listing Keys - Delete Keys - Dictionary - Interface - Keys

Homepage: http://code.activestate.com/

Developer: code.activestate.com

License: Freeware

Operating System: All

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

nldict is a Ruby interface to the on-line version of the one volume Van Dale Hedendaags Nederlands, a renowned dictionary of the modern Dutch language.

developer Developer: caliban.org
license License: Freeware
operating systems Operating System: All


Scrabble Dictionary is both a dictionary and word builder for Scrabble®-like games.

developer Developer: scrabbledict
license License: GNU General Public License (GPL)
operating systems Operating System: OS Independent (Written in an interpreted language)


This is a great way to get repeat visitors.

developer Developer: Intelliscript.net
license License: Freeware
operating systems Operating System: Linux, Unix, Windows


Have you ever thought of adding a Vocabulary List to your site.

developer Developer: t-dreams.com
license License: Freeware
operating systems Operating System: All


This script allows you to record the order in which items are added.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script is a template for a program that opens, saves, deletes and adds entries to a dictionary object.

developer Developer: ww25.uselesspython.com
license License: Freeware
operating systems Operating System: All


Glossword Glossary Compiler helps you to create and publish online multilingual dictionary, glossary, or reference.

developer Developer: SourceForge.net
license License: Freeware
operating systems Operating System: All


Common python services such as pickle, deepcopy and comparison tests either fail entirely or do not scale for highly recursive data structures.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This module provides several functions that can encode and decode a string.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All