Package Gnumed :: Package pycommon :: Module gmNull :: Class cNull
[frames] | no frames]

Class cNull

source code

object --+
         |
        cNull

A class for implementing Null objects.

This class ignores all parameters passed when constructing or calling instances and traps all attribute and method requests. Instances of it always (and reliably) do 'nothing'.

The code might benefit from implementing some further special Python methods depending on the context in which its instances are used. Especially when comparing and coercing Null objects the respective methods' implementation will depend very much on the environment and, hence, these special methods are not provided here.

Instance Methods
 
__init__(self, *args, **kwargs)
Ignore parameters.
source code
 
__call__(self, *args, **kwargs)
Ignore method calls.
source code
 
__getattr__(self, attribute)
Ignore attribute requests.
source code
 
__setattr__(self, attribute, value)
Ignore attribute setting.
source code
 
__delattr__(self, attribute)
Ignore deleting attributes.
source code
 
__getitem__(self, item)
Ignore item requests.
source code
 
__setitem__(self, item, value)
Ignore item setting.
source code
 
__delitem__(self, item)
Ignore deleting items.
source code
 
__repr__(self)
Return a string representation.
source code
 
__str__(self)
Convert to a string and return it.
source code
 
__nonzero__(self) source code
 
__len__(self) source code

Inherited from object: __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __sizeof__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, *args, **kwargs)
(Constructor)

source code 

Ignore parameters.

Overrides: object.__init__

__setattr__(self, attribute, value)

source code 

Ignore attribute setting.

Overrides: object.__setattr__

__delattr__(self, attribute)

source code 

Ignore deleting attributes.

Overrides: object.__delattr__

__repr__(self)
(Representation operator)

source code 

Return a string representation.

Overrides: object.__repr__

__str__(self)
(Informal representation operator)

source code 

Convert to a string and return it.

Overrides: object.__str__