Registry / devops / null
library0.6.1pypypiunverified

Implements the null object pattern in Python, providing a `Null` singleton that absorbs method calls and attribute accesses without raising errors. Current version 0.6.1. Release cadence is low, last updated in 2020.

pip install null
INSTALL
IMPORT
SIG · NULL
N
null
devopspythonv0.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Null
from null import Null
from null import Null

Create a null object and check if a value is null.

from null import Null, has_value null = Null() print(null.some_attr) # prints nothing, no error print(has_value(null)) # False print(null == Null) # True
Debug
Known issues
gotchaUsing `Null()` returns the same singleton instance; comparisons with `==` work but `is` should be used for identity.
fix
Use `obj is Null` to check for null identity.
affects: all
gotchaThe library does not handle pickling; `Null` objects cannot be pickled directly.
fix
Implement custom serialization or avoid pickling.
affects: all
Upgrade
Version history
0.6.1latest on PyPI · released Mar 5, 2013
Audit
Dependencies

No dependency data recorded yet.

Agent activity
44 hits · last 30 days
node
38
Amazon
1
OpenAI (training)
1
Resources
null — pip install null · libregistry