-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expand file tree
/
Copy pathElementInclude.pyi
More file actions
27 lines (20 loc) · 1.15 KB
/
ElementInclude.pyi
File metadata and controls
27 lines (20 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from _typeshed import FileDescriptorOrPath
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: ...
@overload
def __call__(self, href: FileDescriptorOrPath, parse: Literal["text"], encoding: str | None = None) -> str: ...
XINCLUDE: Final = "{http://www.w3.org/2001/XInclude}"
XINCLUDE_INCLUDE: Final = "{http://www.w3.org/2001/XInclude}include"
XINCLUDE_FALLBACK: Final = "{http://www.w3.org/2001/XInclude}fallback"
DEFAULT_MAX_INCLUSION_DEPTH: Final = 6
class FatalIncludeError(SyntaxError): ...
@overload
def default_loader(href: FileDescriptorOrPath, parse: Literal["xml"], encoding: str | None = None) -> Element: ...
@overload
def default_loader(href: FileDescriptorOrPath, parse: Literal["text"], encoding: str | None = None) -> str: ...
def include(elem: Element, loader: _Loader | None = None, base_url: str | None = None, max_depth: int | None = 6) -> None: ...
class LimitedRecursiveIncludeError(FatalIncludeError): ...