niltype
A singleton Nil object to represent missing values when None is a valid data value
Decision gist · record as of 2026-08-14
Yes, if you have a codebase where `None` is a valid data value and you need a distinct sentinel. The package is tiny, has no dependencies, is MIT-licensed, and solves a real semantic problem. Dormant maintenance is not a concern for a single-purpose utility with no external dependencies. Install it if the pattern fits your domain; skip it if you can use a different sentinel (e.g., a custom class) or if `None` is always sufficient.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with no runtime dependencies.
- Maintenance is dormant—last commit was 2024-09-21 and no activity since, though the repository remains open and the package is typed.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) places no restrictions on use, modification, or redistribution in commercial or private projects.
last release 2024-09-21 (692 days) · last repo commit 2024-09-21 · 1 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 100,117 downloads/mo, #13,001 on PyPI
Alternatives
Verify before relying
pip install niltype
from niltype import Nil
if x is Nil:
print("x is missing")- Whether Nil works correctly with type checkers (mypy, pyright) beyond the Nilable type alias provided
- Performance characteristics when used in tight loops or large data structures
- Compatibility with pickle, dataclass, or other serialization frameworks
What it is and what it does
NilType provides a `Nil` singleton—a distinct sentinel value for representing the absence of data when `None` itself is a meaningful value in your data model. This solves a real problem in Python: when your domain allows `None` as a valid entry (e.g., a database field that can legitimately store null), you need a separate marker to mean 'no value provided' or 'undefined'. The package exports `Nil` for identity checks and a `Nilable` type alias for type annotations.
The typical use case is function signatures where you want to distinguish between an explicit `None` argument and no argument at all. For example, a `get()` function can use `Nil` as its default parameter value, then check `if default is not Nil` to know whether the caller passed something. The package is minimal—no dependencies, pure Python, and typed—making it a lightweight addition to any codebase that needs this pattern.
Use it for
- Default function parameters: distinguish between an explicit `None` and an unspecified argument using `Nil` as the default.
- Data model fields: represent missing or undefined values in classes or dataclasses where `None` is a valid stored value.
- Optional configuration: mark configuration values as explicitly unset (Nil) versus set to None or a default.
- Type-hinted optional values: use `Nilable[T]` in function signatures to document that a value can be a type or Nil.
- Sentinel-based control flow: use identity checks (`is Nil`) to branch on whether a value was explicitly provided.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you have a codebase where `None` is a valid data value and you need a distinct sentinel.
The package is tiny, has no dependencies, is MIT-licensed, and solves a real semantic problem. Dormant maintenance is not a concern for a single-purpose utility with no external dependencies. Install it if the pattern fits your domain; skip it if you can use a different sentinel (e.g., a custom class) or if `None` is always sufficient.
Install
niltype on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is dormant—last commit was 2024-09-21 and no activity since, though the repository remains open and the package is typed.
License in practice
MIT license (permissive) places no restrictions on use, modification, or redistribution in commercial or private projects.
Quickstart
pip install niltype
from niltype import Nil
if x is Nil:
print("x is missing")
Verify before relying
- Whether Nil works correctly with type checkers (mypy, pyright) beyond the Nilable type alias provided
- Performance characteristics when used in tight loops or large data structures
- Compatibility with pickle, dataclass, or other serialization frameworks
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 692 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 100,117 / month, #13,001 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Typing :: Typed |
Evidence: niltype-1.0.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “nil object python”
- niltypeProvides a `Nil` singleton object to represent missing or undefined…
- CFGraphCFGraph extends rdflib's Graph to read RDF collections as flattened…
- objgraphObjgraph lets you visualize and explore Python object reference…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also sentinel · nulltype · sentinels · func_args · solus · Redis-Sentinel-Url · singleton-decorator · pyjon.utils · redis-cli · result