Add @type_check_only to stub-only private classes in stdlib (#14512)

This commit is contained in:
Brian Schubert
2025-08-03 04:13:16 -04:00
committed by GitHub
parent dde70aeecd
commit 622df68c1c
61 changed files with 188 additions and 51 deletions
+2 -1
View File
@@ -13,7 +13,7 @@ from _imp import (
from _typeshed import StrPath
from os import PathLike
from types import TracebackType
from typing import IO, Any, Protocol
from typing import IO, Any, Protocol, type_check_only
SEARCH_ERROR: int
PY_SOURCE: int
@@ -39,6 +39,7 @@ class NullImporter:
# Technically, a text file has to support a slightly different set of operations than a binary file,
# but we ignore that here.
@type_check_only
class _FileLike(Protocol):
closed: bool
mode: str