Package param :: Class ClassSelector
[hide private]
[frames] | no frames]

Class ClassSelector

source code


Parameter whose value is an instance of the specified class.
Nested Classes [hide private]

Inherited from parameterized.Parameter: __metaclass__

Instance Methods [hide private]
 
__init__(self, class_, default=None, instantiate=True, allow_None=False, **params)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_check_value(self, val, obj=None)
val must be None or an instance of self.class_
source code
 
__set__(self, obj, val)
Set the value for this Parameter.
source code
 
get_range(self)
Return the possible types for this parameter's value.
source code

Inherited from parameterized.Parameter: __delete__, __get__, __getstate__, __setstate__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __classdoc = '\n Parameter whose value is an instance of th...
str(object) -> string
Properties [hide private]
  allow_None
  class_

Inherited from parameterized.Parameter: constant, default, doc, instantiate, pickle_default_value, precedence, readonly

Inherited from object: __class__

Method Details [hide private]

__init__(self, class_, default=None, instantiate=True, allow_None=False, **params)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

__set__(self, obj, val)

source code 

Set the value for this Parameter.

If called for a Parameterized class, set that class's value (i.e. set this Parameter object's 'default' attribute).

If called for a Parameterized instance, set the value of this Parameter on that instance (i.e. in the instance's __dict__, under the parameter's internal_name).

If the Parameter's constant attribute is True, only allows the value to be set for a Parameterized class or on uninitialized Parameterized instances.

If the Parameter's readonly attribute is True, only allows the value to be specified in the Parameter declaration inside the Parameterized source code. A read-only parameter also cannot be set on a Parameterized class.

Note that until we support some form of read-only object, it is still possible to change the attributes of the object stored in a constant or read-only Parameter (e.g. the left bound of a BoundingBox).

Overrides: parameterized.Parameter.__set__
(inherited documentation)

get_range(self)

source code 

Return the possible types for this parameter's value.

(I.e. return {name: <class>} for all classes that are
concrete_descendents() of self.class_.)

Only classes from modules that have been imported are added
(see concrete_descendents()).

Overrides: Selector.get_range

Class Variable Details [hide private]

__classdoc

str(object) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Value:
'''
    Parameter whose value is an instance of the specified class.    
    '''