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

Package param

source code

Parameters are a kind of class attribute allowing special behavior, including dynamically generated parameter values, documentation strings, constant and read-only parameters, and type or range checking at assignment time.

Potentially useful for any large Python program that needs user-modifiable object attributes; see the parameterized.Parameter and parameterized.Parameterized classes for more information.

This file contains subclasses of Parameter, implementing specific parameter types (e.g. Number).

$Id: __init__.py 9414 2008-10-08 10:08:23Z ceball $


Version: $Revision: 9414 $

Submodules [hide private]

Classes [hide private]
  Enumeration
Enumeration is a Parameter with a list of available values.
  Dynamic
Parameter whose value can be generated dynamically by a callable object.
  Number
Number is a numeric parameter.
  Integer
Number is a numeric parameter.
  Magnitude
Number is a numeric parameter.
  Boolean
An attribute descriptor for declaring parameters.
  String
An attribute descriptor for declaring parameters.
  NumericTuple
An attribute descriptor for declaring parameters.
  XYCoordinates
An attribute descriptor for declaring parameters.
  Callable
Parameter holding a value that is a callable object, such as a function.
  Composite
A parameter that is in fact a composite of a set of other parameters or attributes of the class.
  Selector
Parameter whose value is set to some form of one of the possibilities in its range.
  ObjectSelector
Parameter whose value is set to an object from its list of possible objects.
  ClassSelector
Parameter whose value is an instance of the specified class.
  List
Parameter whose value is a list of objects, usually of a specified type.
  HookList
Parameter whose value is a list of callable objects.
  Dict
Parameter whose value is a dictionary.
  InstanceMethodWrapper
Wrapper for pickling instance methods.
Functions [hide private]
 
produce_value(value_obj)
A helper function that produces an actual parameter from a stored object: if the object is callable, call it, otherwise return the object.
source code
 
wrap_callable(c)
Wrap a callable object in an InstanceMethodWrapper, if necessary.
source code
 
concrete_descendents(parentclass)
Return a dictionary containing all subclasses of the specified parentclass, including the parentclass.
source code
Function Details [hide private]

wrap_callable(c)

source code 

Wrap a callable object in an InstanceMethodWrapper, if necessary.

If c is an instancemethod, then wrap it and return the wrapper, otherwise return c.

concrete_descendents(parentclass)

source code 

Return a dictionary containing all subclasses of the specified parentclass, including the parentclass. Only classes that are defined in scripts that have been run or modules that have been imported are included, so the caller will usually first do from package import *.

If the class has an attribute abstract, and it is True, the class will not be included.