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
+3 -1
View File
@@ -2,7 +2,7 @@ import sys
from _typeshed import MaybeNone, StrOrBytesPath, SupportsWrite
from collections.abc import Callable, ItemsView, Iterable, Iterator, Mapping, MutableMapping, Sequence
from re import Pattern
from typing import Any, ClassVar, Final, Literal, TypeVar, overload
from typing import Any, ClassVar, Final, Literal, TypeVar, overload, type_check_only
from typing_extensions import TypeAlias
if sys.version_info >= (3, 14):
@@ -104,7 +104,9 @@ else:
]
if sys.version_info >= (3, 13):
@type_check_only
class _UNNAMED_SECTION: ...
UNNAMED_SECTION: _UNNAMED_SECTION
_SectionName: TypeAlias = str | _UNNAMED_SECTION