Dictionary Mixin / Framework 1.1 Python script

SPONSORED LINKS

    Specification

  • Version: 1.1
  • File size: 0 KB
  • File name: index_txt
  • Last update:
  • Platform: Windows / Linux / Mac OS / BSD / Solaris
  • Language: Python
  • Price:Other Free / Open So
  • Company: Raymond Hettinger (View more)

Dictionary Mixin / Framework 1.1 script description:




Publisher review:
Dictionary Mixin / Framework 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. 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.
Dictionary Mixin / Framework 1.1 is a Python script for Programming Methods and Algorithms scripts design by Raymond Hettinger. It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
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.

Operating system:
Windows / Linux / Mac OS / BSD / Solaris

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5