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
@@ -20,7 +20,7 @@ from _hashlib import (
)
from _typeshed import ReadableBuffer
from collections.abc import Callable, Set as AbstractSet
from typing import Protocol
from typing import Protocol, type_check_only
if sys.version_info >= (3, 11):
__all__ = (
@@ -72,9 +72,11 @@ algorithms_guaranteed: AbstractSet[str]
algorithms_available: AbstractSet[str]
if sys.version_info >= (3, 11):
@type_check_only
class _BytesIOLike(Protocol):
def getbuffer(self) -> ReadableBuffer: ...
@type_check_only
class _FileDigestFileObj(Protocol):
def readinto(self, buf: bytearray, /) -> int: ...
def readable(self) -> bool: ...