From a6bdb25991ab948f8619b1381709e51616a1270d Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sun, 10 Mar 2024 16:20:35 -0700 Subject: [PATCH] typing: Deprecate creating a NamedTuple with kwargs (#11567) https://github.com/python/cpython/blob/c5fa796619a8cae5a1a8a4a043d05a99adec713d/Lib/typing.py#L2874 --- stdlib/typing.pyi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index c42acd4bf..be0c29c89 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -871,6 +871,9 @@ class NamedTuple(tuple[Any, ...]): @overload def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None: ... @overload + @typing_extensions.deprecated( + "Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15" + ) def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None: ... @classmethod def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ...