Package topo :: Package param :: Module parameterized
[hide private]
[frames] | no frames]

Module parameterized

source code

Generic support for objects with full-featured Parameters and messaging.

$Id: parameterized.py 9417 2008-10-08 20:23:33Z ceball $


Version: $Revision: 9417 $

Classes [hide private]
  bothmethod
'optional @classmethod'
  ParameterMetaclass
Metaclass allowing control over creation of Parameter classes.
  Parameter
An attribute descriptor for declaring parameters.
  ParameterizedMetaclass
The metaclass of Parameterized (and all its descendents).
  Parameterized
Base class for named objects that support Parameters and message formatting.
  PicklableClassAttributes
Supports pickling of Parameterized class attributes for a given module.
  ParamOverrides
A dictionary that returns the attribute of an object if that attribute is not present in itself.
Functions [hide private]
 
classlist(class_)
Return a list of the class hierarchy above (and including) the given class.
source code
 
descendents(class_)
Return a list of the class hierarchy below (and including) the given class.
source code
 
get_all_slots(class_)
Return a list of slot names for slots defined in this class and its superclasses.
source code
 
script_repr(val, imports, prefix, settings)
Variant of repr() designed for generating a runnable script.
source code
 
container_script_repr(container, imports, prefix, settings) source code
 
function_script_repr(fn, imports, prefix, settings) source code
 
as_uninitialized(fn)
Decorator: call fn with the parameterized_instance's initialization flag set to False, then revert the flag.
source code
 
print_all_param_defaults()
Print the default values for all imported Parameters.
source code
Variables [hide private]
  SILENT = 0
  WARNING = 50
  NORMAL = 100
  MESSAGE = 100
  VERBOSE = 200
  DEBUG = 300
  min_print_level = 100
  warnings_as_exceptions = False
  object_count = 200
  script_repr_suppress_defaults = True
  script_repr_reg = {}
  _param_name_changes = {}
Function Details [hide private]

classlist(class_)

source code 

Return a list of the class hierarchy above (and including) the given class.

Same as inspect.getmro(class_)[::-1]

descendents(class_)

source code 

Return a list of the class hierarchy below (and including) the given class.

The list is ordered from least- to most-specific. Can be useful for printing the contents of an entire class hierarchy.

script_repr(val, imports, prefix, settings)

source code 

Variant of repr() designed for generating a runnable script.

Types that require special handling can use the script_repr_reg dictionary. Using the type as a key, add a function that returns a suitable representation of instances of that type, and adds the required import statement.

as_uninitialized(fn)

source code 

Decorator: call fn with the parameterized_instance's initialization flag set to False, then revert the flag.

(Used to decorate Parameterized methods that must alter a constant Parameter.)