namedlist
Similar to namedtuple, but instances are mutable.
What it is and what it does
namedlist provides two factory functions—namedlist and namedtuple—that generate named tuple-like classes with enhanced default-value handling. The key difference from collections.namedtuple is that namedlist instances are mutable (you can reassign fields after creation), while namedtuple instances remain immutable. Both support per-field defaults, a global default value applied to all fields without explicit defaults, and factory functions for mutable defaults like lists.
The package is no longer maintained and its own documentation warns users to prefer built-in dataclasses instead. It has no runtime dependencies and installs as a pure Python wheel. It was last released 2020-08-30 and has not been updated since, so it should be considered legacy code suitable only for maintaining existing projects.
Use it for:
- Maintaining code that already depends on namedlist for mutable named tuple behavior.
- Creating lightweight mutable data structures with named fields and sensible defaults.
- Defining immutable records with per-field defaults when per-field default support is needed.
- Building tuple-like objects that support attribute access, iteration, and selective field updates.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Creates mutable or immutable named tuple-like classes with support for per-field and global default values.
No, unless maintaining legacy code. The package is abandoned and explicitly recommends using built-in dataclasses instead. For new projects, dataclasses provide superior maintainability and ongoing language support. Install only to maintain or understand existing code that already depends on namedlist.
Install
namedlist on PyPI
pip
pip install namedlistuv
uv add namedlistpoetry
poetry add namedlistInstalling namedlist
Before you install
Installation is frictionless (pure Python wheel, no dependencies), but the package is abandoned as of 2020-08-30 and explicitly recommends using built-in dataclasses instead.
License in practice
Licensed under Apache License Version 2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
from namedlist import namedlist
Point = namedlist('Point', 'x y')
p = Point(1, 3)
p.x = 2
assert p.x == 2
Verify before relying
- Whether dataclasses truly supersedes all namedlist use cases or if mutable behavior remains distinct.
- Current compatibility with Python versions beyond 3.8 (last tested version in classifiers).
- Whether the package works correctly with modern Python despite no maintenance since 2020-08-30.
Package facts
| License | Apache License Version 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,175 days since the last release |
| First released | |
| Downloads | 120,809/month — #12,009 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: namedlist-1.8-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
recordclassRecordclass provides memory-efficient, mutable…
permissive · top 15,000 on PyPI
recordtyperecordtype creates mutable record classes with…
permissive · top 15,000 on PyPI
immutablesProvides an immutable mapping type backed by a…
permissive · top 5,000 on PyPI
fieldsGenerates lightweight container classes with…
permissive · top 15,000 on PyPI
tinselGenerates PySpark DataFrame schemas from Python…
permissive · top 15,000 on PyPI
fixedintProvides fixed-width integer classes that…
permissive · top 5,000 on PyPI
constantdictProvides an immutable dictionary class that…
permissive · top 15,000 on PyPI
ordered-setOrderedSet is a mutable collection that…
permissive · top 1,000 on PyPI
orderly-setProvides multiple ordered set implementations…
permissive · top 1,000 on PyPI
multisetProvides a mutable and immutable multiset data…
permissive · top 15,000 on PyPI