{"id":45621,"library":"null","title":"null","description":"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.","status":"active","version":"0.6.1","language":"python","source_language":"en","source_url":"https://github.com/simonluijk/null","tags":["null-object","pattern","sentinel"],"install":[{"cmd":"pip install null","lang":"bash","label":"Install"}],"dependencies":[],"imports":[{"wrong":"from null import Null","symbol":"Null","correct":"from null import Null"}],"quickstart":{"code":"from null import Null, has_value\n\nnull = Null()\nprint(null.some_attr)  # prints nothing, no error\nprint(has_value(null))  # False\nprint(null == Null)     # True","lang":"python","description":"Create a null object and check if a value is null."},"warnings":[{"fix":"Use `obj is Null` to check for null identity.","message":"Using `Null()` returns the same singleton instance; comparisons with `==` work but `is` should be used for identity.","severity":"gotcha","affected_versions":"all"},{"fix":"Implement custom serialization or avoid pickling.","message":"The library does not handle pickling; `Null` objects cannot be pickled directly.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.6.1':25 '2020':33 'absorb':14 'access':19 'attribut':18 'cadenc':27 'call':16 'current':23 'error':22 'implement':2 'last':30 'low':29 'method':15 'null':1,4,11,35 'null-object':34 'object':5,36 'pattern':6,37 'provid':9 'python':8 'rais':21 'releas':26 'sentinel':38 'singleton':12 'updat':31 'version':24 'without':20","created_at":"2026-06-07T12:55:54.272576+00:00","updated_at":"2026-06-07T12:55:54.272576+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpj3701r1f/venv/lib/python3.12/site-packages/null.py\", line 35, in <module>\n    from collections import MutableMapping, MutableSequence\nImportError: cannot import name 'MutableMapping' from 'collections' (/home/x"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://bitbucket.org/ambv/null","github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}