Package peppy :: Package lib :: Module null :: Class Null
[frames] | no frames]

Class Null

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.
 
__call__(self, *args, **kwargs)
Ignore method calls.
 
__getattr__(self, mname)
Ignore attribute requests.
 
__setattr__(self, name, value)
Ignore attribute setting.
 
__delattr__(self, name)
Ignore deleting attributes.
 
__repr__(self)
Return a string representation.
 
__str__(self)
Convert to a string and return it.