basicproperty.defaults
index
p:\properties\basicproperty\defaults.py

Holders for property default values/functions
 
The default object simply provides an interface for
different approaches to defining default arguments.
The current implementation provides static and
dynamic default values.

 
Classes
       
object
Default
DefaultCallable
DefaultValue

 
class Default(object)
    Abstract holder for a default-value or function
 
This is the base class for property default
classes.  It is primarily an interface definition.
 
  Methods defined here:
__call__(self, property, client)
Return appropriate default value
 
This just returns the results of:
        get( property, client )
__init__(self, value)
Initialize the Default holder
 
value -- the base value stored in the
        object, see sub-classes for semantics
        of how the object is treated.
get(self, property, client)
Get the value

Data and other attributes defined here:
__dict__ = <dictproxy object at 0x02713A30>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Default' objects>
list of weak references to the object (if defined)

 
class DefaultCallable(Default)
    A holder for a callable object producing default values
 
The callable object is called with the signature:
 
        callable( property, client )
 
where client is the instance object and property
is the BasicProperty itself.
 
 
Method resolution order:
DefaultCallable
Default
object

Methods defined here:
__init__(self, value)
Initialize the Default holder
 
value -- the base value stored in the
        object, see sub-classes for semantics
        of how the object is treated.
get(self, property, client)
Return the result of our callable value

Methods inherited from Default:
__call__(self, property, client)
Return appropriate default value
 
This just returns the results of:
        get( property, client )

Data and other attributes inherited from Default:
__dict__ = <dictproxy object at 0x027138F0>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Default' objects>
list of weak references to the object (if defined)

 
class DefaultValue(Default)
    A holder for a default value
 
The default value is returned without modification,
so using mutable objects will retrieve the same
instance for all calls to get()
 
 
Method resolution order:
DefaultValue
Default
object

Methods defined here:
get(self, property, client)
Get the value unmodified

Methods inherited from Default:
__call__(self, property, client)
Return appropriate default value
 
This just returns the results of:
        get( property, client )
__init__(self, value)
Initialize the Default holder
 
value -- the base value stored in the
        object, see sub-classes for semantics
        of how the object is treated.

Data and other attributes inherited from Default:
__dict__ = <dictproxy object at 0x02713E90>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Default' objects>
list of weak references to the object (if defined)