From 6d0a504b92924d7b4bf109074f9cc37cabff800f Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 6 Sep 2025 15:19:23 -0700 Subject: [PATCH 1/2] Add @disjoint_base to builtins.tuple Should be safe now that we've updated pyright. --- stdlib/builtins.pyi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index f2ce8a60ccbf..bcfc81622179 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1021,8 +1021,7 @@ class slice(Generic[_StartT_co, _StopT_co, _StepT_co]): def indices(self, len: SupportsIndex, /) -> tuple[int, int, int]: ... -# Making this a disjoint_base upsets pyright -# @disjoint_base +@disjoint_base class tuple(Sequence[_T_co]): def __new__(cls, iterable: Iterable[_T_co] = ..., /) -> Self: ... def __len__(self) -> int: ... From ad645d78b137a3a9bfd35bc78c599f82f7fd8667 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 6 Sep 2025 15:31:36 -0700 Subject: [PATCH 2/2] allowlist --- stdlib/@tests/stubtest_allowlists/common.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index b9cb4f3f13f6..76226faf9e97 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -10,7 +10,6 @@ importlib.abc.PathEntryFinder.find_spec # Not defined on the actual class, but tkinter.simpledialog.[A-Z_]+ tkinter.simpledialog.TclVersion tkinter.simpledialog.TkVersion -builtins.tuple # should have @disjoint_base but hits pyright issue tarfile.TarInfo.__slots__ # it's a big dictionary at runtime and the dictionary values are a bit long