A minimal, deterministic utility for checking whether a value is exactly None.
is-none provides a single, explicit function for identity-based None checks in Python.
It exists to make intent unambiguous in codebases where clarity, correctness, and
long-term maintainability are prioritised.
The behaviour is deliberately trivial and fully specified. There is no coercion, no
interpretation of truthiness, and no behaviour beyond an identity comparison against
the singleton None.
This package is suitable for production use, testing utilities, and type-sensitive environments.
-
Explicit semantics
The function performs an identity comparison (value is None) and nothing else. -
Deterministic behaviour
The result depends solely on object identity. There are no side effects. -
Minimal surface area
A single public function with a stable signature. -
Zero dependencies
No runtime dependencies and no optional integrations. -
Long-term stability
The API is intentionally complete and not expected to change.
pip install is-nonefrom is_none import is_none
is_none(None) # True
is_none(0) # False
is_none("") # False
is_none(False) # False
is_none([]) # FalseDetermine whether a value is exactly None.
The function uses identity comparison and does not consider other falsy values
(e.g. 0, "", False, empty containers) to be equivalent to None.
- value (
Any) The value to evaluate.
- bool
Trueif and only ifvalue is None.
In large or long-lived codebases, implicit truthiness checks can obscure intent:
if not value:
...This pattern conflates None with other falsy values and can lead to subtle bugs or
reduced readability.
is-none exists to make the check explicit:
if is_none(value):
...This can be particularly useful in:
- shared utility libraries
- validation and normalisation layers
- testing and assertion helpers
- codebases with strict linting or typing requirements
The following are explicitly out of scope for this project:
- Providing aliases such as
is_not_none - Supporting custom sentinel values
- Treating falsy values as equivalent to
None - Adding configuration, flags, or environment-based behaviour
- Expanding into a general-purpose validation or typing library
If your use case requires any of the above, this package is likely not a good fit.
This project follows Semantic Versioning.
Version 1.0.0 represents a stable, production-ready API.
No breaking changes are anticipated.
- Python 3.13+
- Platform-independent
- No reliance on implementation-specific behaviour
This project is licensed under the MIT License. See the LICENSE file for details.
This project is complete and maintained. No additional features are currently planned.