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

This commit is contained in:
Brian Schubert
2025-08-03 10:13:16 +02:00
committed by GitHub
parent dde70aeecd
commit 622df68c1c
61 changed files with 188 additions and 51 deletions
+2 -1
View File
@@ -3,7 +3,7 @@ import sys
from _typeshed import BytesPath, ExcInfo, FileDescriptorOrPath, MaybeNone, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite
from collections.abc import Callable, Iterable, Sequence
from tarfile import _TarfileFilter
from typing import Any, AnyStr, NamedTuple, NoReturn, Protocol, TypeVar, overload
from typing import Any, AnyStr, NamedTuple, NoReturn, Protocol, TypeVar, overload, type_check_only
from typing_extensions import TypeAlias, deprecated
__all__ = [
@@ -79,6 +79,7 @@ def copytree(
_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], str, ExcInfo], object]
_OnExcCallback: TypeAlias = Callable[[Callable[..., Any], str, BaseException], object]
@type_check_only
class _RmtreeType(Protocol):
avoids_symlink_attacks: bool
if sys.version_info >= (3, 12):