Package httxlib :: Module httxoptions :: Class HttxOption
[hide private]
[frames] | no frames]

Class HttxOption

source code

object --+
         |
        HttxOption

A class representing an individual option.

The class is implemented as a descriptor. The class locks access automatically on access (read/write) to the storage by using the lock from the instance object accessing the option.

Instance Methods [hide private]
 
__init__(self, name, defvalue)
Constructor.
source code
Opaque type. Each option may have different types
__get__(self, instance, owner)
Descriptor get
source code
 
__set__(self, instance, value)
Descriptor set
source code

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

Instance Variables [hide private]
Opaque type. Each option may have different types defvalue
Default value of the option
str name
Name of the option
dict storage
Actual storage for the option value(s) on a per instance (descriptor) basis
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, defvalue)
(Constructor)

source code 

Constructor. Initializes the member variables

Parameters:
  • name (str) - Name of the option
  • defvalue (Opaque type. Each option may have different types) - Default value of the option
Overrides: object.__init__

__get__(self, instance, owner)

source code 

Descriptor get

Parameters:
  • instance (object instance) - instance that wants to access the storage
  • owner (Not used) - Not used but needed for descriptor implementation
Returns: Opaque type. Each option may have different types
the value of the requested option (the default value if the option had not been set yet

__set__(self, instance, value)

source code 

Descriptor set

Parameters:
  • instance (object instance) - instance that wants to access the storage
  • value (Opaque type. Each option may have different types) - Value to set