mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-19 06:33:55 +08:00
Add @type_check_only to stub-only private classes in stdlib (#14512)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user