From 79dc9417e9fd63a0fb74ad36e0200e688b37c02a Mon Sep 17 00:00:00 2001 From: Eric Werner Date: Mon, 25 Oct 2021 18:09:19 +0200 Subject: [PATCH 1/4] Update `ModuleType` to have `__path__` optionally --- stdlib/types.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/types.pyi b/stdlib/types.pyi index e18c5bd3f550..e898a95e568c 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -174,6 +174,7 @@ class ModuleType: __dict__: dict[str, Any] __loader__: _LoaderProtocol | None __package__: str | None + __path__: str | None __spec__: ModuleSpec | None def __init__(self, name: str, doc: str | None = ...) -> None: ... From 2185694d726fce0649acfbe12e220505aa112b1e Mon Sep 17 00:00:00 2001 From: Eric Werner Date: Mon, 25 Oct 2021 21:19:32 +0200 Subject: [PATCH 2/4] `ModuleType.__path__` to be `list[str]`! --- stdlib/types.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/types.pyi b/stdlib/types.pyi index e898a95e568c..11962a9de97c 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -174,7 +174,7 @@ class ModuleType: __dict__: dict[str, Any] __loader__: _LoaderProtocol | None __package__: str | None - __path__: str | None + __path__: list[str] __spec__: ModuleSpec | None def __init__(self, name: str, doc: str | None = ...) -> None: ... From 96532a540da2bdb51d07e082ef7fabbefbe9d6ef Mon Sep 17 00:00:00 2001 From: Eric Werner Date: Mon, 25 Oct 2021 22:05:21 +0200 Subject: [PATCH 3/4] Update stdlib/types.pyi `ModuleType.__path__` to be `MutableSequences[str]` covering `list` and `_NamespacePath` Co-authored-by: Akuli --- stdlib/types.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 11962a9de97c..8cfba20f2327 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -174,7 +174,7 @@ class ModuleType: __dict__: dict[str, Any] __loader__: _LoaderProtocol | None __package__: str | None - __path__: list[str] + __path__: MutableSequence[str] __spec__: ModuleSpec | None def __init__(self, name: str, doc: str | None = ...) -> None: ... From 9fad54806f1574c7e57b183aba86d9449a5ab1ad Mon Sep 17 00:00:00 2001 From: Eric Werner Date: Mon, 25 Oct 2021 22:09:57 +0200 Subject: [PATCH 4/4] importing `MutableSequence` --- stdlib/types.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 8cfba20f2327..e60c6475e2e9 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -14,6 +14,7 @@ from typing import ( Iterator, KeysView, Mapping, + MutableSequence, Tuple, Type, TypeVar,