mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-07 04:34:33 +08:00
Add __replace__ to namedtuple and structseq (#11939)
mypy will need its own change to truly understand namedtuple
This commit is contained in:
1 parent
abfb72e106
commit
54b39e1de4
2 files changed
+4
No files matched your search
@@ -935,6 +935,8 @@ class NamedTuple(tuple[Any, ...]):
|
||||
def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ...
|
||||
def _asdict(self) -> dict[str, Any]: ...
|
||||
def _replace(self, **kwargs: Any) -> typing_extensions.Self: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def __replace__(self, **kwargs: Any) -> typing_extensions.Self: ...
|
||||
|
||||
# Internal mypy fallback type for all typed dicts (does not exist at runtime)
|
||||
# N.B. Keep this mostly in sync with typing_extensions._TypedDict/mypy_extensions._TypedDict
|
||||
|
||||
Reference in new issue
Block a user