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

This commit is contained in:
Brian Schubert authored and GitHub committed 2025-08-03 10:13:16 +02:00
1 parent dde70aeecd
commit 622df68c1c
61 files changed
+188 -51

No files matched your search

+3 -1
View File
@@ -3,7 +3,7 @@ from _collections_abc import dict_keys, dict_values
from _typeshed import Incomplete, ReadableBuffer, SupportsRead, SupportsWrite
from collections.abc import Iterable, Sequence
from types import TracebackType
from typing import Any, ClassVar, Generic, Literal, NoReturn, Protocol, TypeVar, overload
from typing import Any, ClassVar, Generic, Literal, NoReturn, Protocol, TypeVar, overload, type_check_only
from typing_extensions import Self, TypeAlias
from xml.dom.minicompat import EmptyNodeList, NodeList
from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS
@@ -40,9 +40,11 @@ _ImportableNodeVar = TypeVar(
| Notation,
)
@type_check_only
class _DOMErrorHandler(Protocol):
def handleError(self, error: Exception) -> bool: ...
@type_check_only
class _UserDataHandler(Protocol):
def handle(self, operation: int, key: str, data: Any, src: Node, dst: Node) -> None: ...