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
@@ -1,7 +1,8 @@
from _typeshed import FileDescriptorOrPath
from typing import Final, Literal, Protocol, overload
from typing import Final, Literal, Protocol, overload, type_check_only
from xml.etree.ElementTree import Element
@type_check_only
class _Loader(Protocol):
@overload
def __call__(self, href: FileDescriptorOrPath, parse: Literal["xml"], encoding: str | None = None) -> Element: ...
+1
View File
@@ -335,6 +335,7 @@ class C14NWriterTarget:
# The target type is tricky, because the implementation doesn't
# require any particular attribute to be present. This documents the attributes
# that can be present, but uncommenting any of them would require them.
@type_check_only
class _Target(Protocol):
# start: Callable[str, dict[str, str], Any] | None
# end: Callable[[str], Any] | None