12 lines
490 B
Python
12 lines
490 B
Python
from typing import BinaryIO, Iterable, TextIO, TypeAlias, TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from string import Template
|
|
from bs4 import BeautifulSoup, Tag
|
|
from .elements import Node
|
|
|
|
Parsable: TypeAlias = "BeautifulSoup | Tag | str | bytes | TextIO | BinaryIO"
|
|
ElementLike: TypeAlias = "BeautifulSoup | Tag | str | Node | Template"
|
|
ElementLikeList: TypeAlias = "Iterable[ElementLike]"
|
|
RenderableElement: TypeAlias = "Node | Iterable[Node]"
|
|
Templates: TypeAlias = "dict[str, Template]"
|