mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 14:46:55 +08:00
typing: Deprecate creating a NamedTuple with kwargs (#11567)
c5fa796619/Lib/typing.py (L2874)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user