# Python: fix TypeError: NamedTuple() got an unexpected keyword argument

DevFeed: [Python: fix TypeError: NamedTuple() got an unexpected keyword argument](<https://devfeed.tech/articles/python-fix-typeerror-namedtuple-got-an-unexpected-keyword-argument-51097.md>)

Original publisher: [Read original article](<https://adamj.eu/tech/2026/08/13/python-fix-typeerror-namedtuple-got-an-unexpected-keyword-argument/>)

Author: Adam Johnson

Published: 2026-08-12T23:00:00Z

Content type: tutorial

Language: en

Sources: [Adam Johnson](<https://devfeed.tech/sources/adam-johnson.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Code](<https://devfeed.tech/topics/code.md>), [deprecated](<https://devfeed.tech/topics/deprecated.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [syntax](<https://devfeed.tech/topics/syntax.md>), [version](<https://devfeed.tech/topics/version.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [deprecated](<https://devfeed.tech/tags/deprecated.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [python](<https://devfeed.tech/tags/python.md>), [release-notes](<https://devfeed.tech/tags/release-notes.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [version](<https://devfeed.tech/tags/version.md>)

## AI overview

This tutorial explains that the undocumented keyword-argument form of Python's NamedTuple was deprecated and removed in Python 3.15. It shows the supported class-based and functional alternatives and notes that Ruff can rewrite the deprecated form to class syntax.

## Source excerpt

Take this code, defining a small NamedTuple with a keyword argument per field: from typing import NamedTuple Point = NamedTuple("Point", x=int, y=int) Run it on Python 3.13 or 3.14, and you'll see: $ python3.14 example.py /.../example.py:3: DeprecationWarning: Creating NamedTuple classes using keyword ...