From a5e316eafdd98ad73847e41436a3158e976ed769 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 22 Jun 2023 19:47:23 +0300 Subject: [PATCH] Do not import `TypedDict` from `mypy-extensions`, use `typing-extensions` (#15494) All recent versions (declared in `setup.py`) have `TypedDict` there. So, no need to use `mypy-extensions` here. (crossref: found while working on https://github.com/typeddjango/django-stubs/pull/1566) --- mypy/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mypy/build.py b/mypy/build.py index 08e85dd28624..5a6f8c00896e 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -38,9 +38,7 @@ Sequence, TextIO, ) -from typing_extensions import Final, TypeAlias as _TypeAlias - -from mypy_extensions import TypedDict +from typing_extensions import Final, TypeAlias as _TypeAlias, TypedDict import mypy.semanal_main from mypy.checker import TypeChecker @@ -343,7 +341,9 @@ class CacheMeta(NamedTuple): # Metadata for the fine-grained dependencies file associated with a module. -FgDepMeta = TypedDict("FgDepMeta", {"path": str, "mtime": int}) +class FgDepMeta(TypedDict): + path: str + mtime: int def cache_meta_from_dict(meta: dict[str, Any], data_json: str) -> CacheMeta: