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.
|
|
|
__call__(self,
*args,
**kwargs)
Ignore method calls. |
source code
|
|
|
__getattr__(self,
attribute)
Ignore attribute requests. |
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
|
|
|
|
|
|
|
|
|
|
Inherited from object :
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__sizeof__ ,
__subclasshook__
|