Package testpackage :: Module util
[hide private]
[frames] | no frames]

Module util

source code

Provides general-purpose utilities.


Author: Kenneth J. Pronovici <pronovic@ieee.org>

Classes [hide private]
  FirstClass
Special list class.
  _SecondClass
Represents something else that I forgot just now.
Functions [hide private]
 
method2(d, keys)
Removes all of the keys from the dictionary.
source code
 
methodOne(d)
Returns the keys of the dictionary sorted by value.
source code
Variables [hide private]
  CONSTANT_ONE = 'one'
The first constant
  CONSTANT_TWO = 'two'
The second constant
  __package__ = None
hash(x)
Function Details [hide private]

method2(d, keys)

source code 

Removes all of the keys from the dictionary. The dictionary is altered in-place. Each key must exist in the dictionary.

Parameters:
  • d - Dictionary to operate on
  • keys - List of keys to remove
Raises:
  • KeyError - If one of the keys does not exist

methodOne(d)

source code 

Returns the keys of the dictionary sorted by value.

There are cuter ways to do this in Python 2.4, but we were originally attempting to stay compatible with Python 2.3.

Parameters:
  • d - Dictionary to operate on
Returns:
List of dictionary keys sorted in order by dictionary value.