skillfed

namedlist

Similar to namedtuple, but instances are mutable.

namedlist v1.8 120.8K downloads/30d#12,009 on PyPI
Permissive license Apache License Version 2.0 Abandoned released

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 namedlist

uv

uv add namedlist

poetry

poetry add namedlist

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Software Development :: Libraries :: Python Modules

Tags

mutable namedtuplenamed tuple with defaultsmutable data structurefield defaultstuple-like class generatorimmutable named recordsfactory function defaults
legacydata-structures

More Python Modules packages