51 lines
1.4 KiB
Python
Raw Permalink Normal View History

# pyright: reportPrivateUsage=false
from __future__ import annotations
from typing import Collection, Generic, Iterator, TypeVar, overload
from typing_extensions import Self
from .. import _types as _t
_T = TypeVar("_T")
class _Element:
@overload
def __getitem__(self, __x: int) -> Self: ...
@overload
def __getitem__(self, __x: slice) -> list[Self]: ...
def __contains__(self, __o: object) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[Self]: ...
def find(self, path: _t._ElemPathArg) -> Self | None: ...
@overload
def get(self, key: _t._AttrName) -> str | None: ...
@overload
def get(self, key: _t._AttrName, default: _T) -> str | _T: ...
def iterancestors(
self, *, tag: _t._TagSelector | Collection[_t._TagSelector] | None = None
) -> Iterator[Self]: ...
@overload
def itertext(self, *tags: _t._TagSelector, with_tail: bool = True) -> Iterator[str]: ...
@overload
def itertext(
self,
*,
tag: _t._TagSelector | Collection[_t._TagSelector] | None = None,
with_tail: bool = True,
) -> Iterator[str]: ...
@property
def tag(self) -> str: ...
@property
def tail(self) -> str | None: ...
@property
def text(self) -> str | None: ...
def xpath(
self,
_path: str,
/,
) -> _t._XPathObject: ...
class _ElementTree(Generic[_t._ET_co]): ...