Make forward references strings

This commit is contained in:
Ismail
2016-03-09 11:58:24 +00:00
parent d21c09919d
commit 8d893cfae8
11 changed files with 150 additions and 150 deletions

View File

@@ -9,10 +9,10 @@ xpath_tokenizer_re = ... # type: Pattern
_token = Tuple[str, str]
_next = Callable[[], _token]
_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]]
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ...
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
def prepare_child(next: _next, token: _token) -> _callback: ...
def prepare_star(next: _next, token: _token) -> _callback: ...
def prepare_self(next: _next, token: _token) -> _callback: ...

View File

@@ -12,45 +12,45 @@ _T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class _SimpleElementPath:
def find(self, element: Element, tag: _str_or_bytes, namespaces: Any=...) -> Optional[Element]: ...
def findtext(self, element: Element, tag: _str_or_bytes, default: _T=..., namespaces: Any=...) -> Union[str, bytes, _T]: ...
def iterfind(self, element: Element, tag: _str_or_bytes, namespaces: Any=...) -> Generator[Element, None, None]: ...
def findall(self, element: Element, tag: _str_or_bytes, namespaces: Any=...) -> List[Element]: ...
def find(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> Optional['Element']: ...
def findtext(self, element: 'Element', tag: _str_or_bytes, default: _T=..., namespaces: Any=...) -> Union[str, bytes, _T]: ...
def iterfind(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> Generator['Element', None, None]: ...
def findall(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> List['Element']: ...
class ParseError(SyntaxError): ...
def iselement(element: Element) -> bool: ...
def iselement(element: 'Element') -> bool: ...
class Element:
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., Element]], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, element: Element) -> None: ...
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, element: 'Element') -> None: ...
def clear(self) -> None: ...
def copy(self) -> Element: ...
def extend(self, elements: Sequence[Element]) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def copy(self) -> 'Element': ...
def extend(self, elements: Sequence['Element']) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional['Element']: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List[Element]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def insert(self, index: int, element: Element) -> None: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, element: 'Element') -> None: ...
def items(self) -> List[Tuple[AnyStr, AnyStr]]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def itertext(self) -> Generator[str, None, None]: ...
def keys(self) -> List[AnyStr]: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> Element: ...
def remove(self, element: Element) -> None: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> 'Element': ...
def remove(self, element: 'Element') -> None: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index) -> Element: ...
def __getitem__(self, index) -> 'Element': ...
def __len__(self) -> int: ...
def __setitem__(self, index: int, element: Element) -> None: ...
def __setitem__(self, index: int, element: 'Element') -> None: ...
def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> Element: ...
def Comment(text: _str_or_bytes=...) -> Element: ...
@@ -68,7 +68,7 @@ _file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> Element: ...
def parse(self, source: _file_or_filename, parser: XMLParser=...) -> Element: ...
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
@@ -82,20 +82,20 @@ def register_namespace(prefix: str, uri: str) -> None: ...
def tostring(element: Element, encoding: str=..., method: str=...) -> str: ...
def tostringlist(element: Element, encoding: str=..., method: str=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: XMLParser=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: XMLParser=...) -> Iterator[Tuple[str, Element]]: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: XMLParser, close_source: bool=...) -> None: ...
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def next(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
def XML(text: AnyStr, parser: XMLParser=...) -> Element: ...
def XMLID(text: AnyStr, parser: XMLParser=...) -> Tuple[Element, Dict[str, Element]]: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., Element]
def fromstringlist(sequence: Sequence[AnyStr], parser: XMLParser=...) -> Element: ...
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], Element]=...) -> None: ...

View File

@@ -9,10 +9,10 @@ xpath_tokenizer_re = ... # type: Pattern
_token = Tuple[str, str]
_next = Callable[[], _token]
_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]]
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ...
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
def prepare_child(next: _next, token: _token) -> _callback: ...
def prepare_star(next: _next, token: _token) -> _callback: ...
def prepare_self(next: _next, token: _token) -> _callback: ...

View File

@@ -12,45 +12,45 @@ _T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class _SimpleElementPath:
def find(self, element: Element, tag: _str_or_bytes, namespaces: Any=...) -> Optional[Element]: ...
def findtext(self, element: Element, tag: _str_or_bytes, default: _T=..., namespaces: Any=...) -> Union[str, bytes, _T]: ...
def iterfind(self, element: Element, tag: _str_or_bytes, namespaces: Any=...) -> Generator[Element, None, None]: ...
def findall(self, element: Element, tag: _str_or_bytes, namespaces: Any=...) -> List[Element]: ...
def find(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> Optional['Element']: ...
def findtext(self, element: 'Element', tag: _str_or_bytes, default: _T=..., namespaces: Any=...) -> Union[str, bytes, _T]: ...
def iterfind(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> Generator['Element', None, None]: ...
def findall(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> List['Element']: ...
class ParseError(SyntaxError): ...
def iselement(element: Element) -> bool: ...
def iselement(element: 'Element') -> bool: ...
class Element:
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., Element]], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, subelement: Element) -> None: ...
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, subelement: 'Element') -> None: ...
def clear(self) -> None: ...
def copy(self) -> Element: ...
def extend(self, elements: Sequence[Element]) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def copy(self) -> 'Element': ...
def extend(self, elements: Sequence['Element']) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional['Element']: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List[Element]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def insert(self, index: int, subelement: Element) -> None: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, subelement: 'Element') -> None: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def itertext(self) -> Generator[str, None, None]: ...
def keys(self) -> KeysView[AnyStr]: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> Element: ...
def remove(self, subelement: Element) -> None: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> 'Element': ...
def remove(self, subelement: 'Element') -> None: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index) -> Element: ...
def __getitem__(self, index) -> 'Element': ...
def __len__(self) -> int: ...
def __setitem__(self, index: int, element: Element) -> None: ...
def __setitem__(self, index: int, element: 'Element') -> None: ...
def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> Element: ...
def Comment(text: _str_or_bytes=...) -> Element: ...
@@ -68,7 +68,7 @@ _file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> Element: ...
def parse(self, source: _file_or_filename, parser: XMLParser=...) -> Element: ...
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
@@ -83,23 +83,23 @@ def tostring(element: Element, encoding: str=..., method: str=...) -> str: ...
def tostringlist(element: Element, encoding: str=..., method: str=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: XMLParser=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: XMLParser=...) -> Iterator[Tuple[str, Element]]: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: XMLParser, close_source: bool=...) -> None: ...
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def __next__(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
def XML(text: AnyStr, parser: XMLParser=...) -> Element: ...
def XMLID(text: AnyStr, parser: XMLParser=...) -> Tuple[Element, Dict[str, Element]]: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., Element]
def fromstringlist(sequence: Sequence[AnyStr], parser: XMLParser=...) -> Element: ...
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], Element]=...) -> None: ...

View File

@@ -9,10 +9,10 @@ xpath_tokenizer_re = ... # type: Pattern
_token = Tuple[str, str]
_next = Callable[[], _token]
_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]]
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ...
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
def prepare_child(next: _next, token: _token) -> _callback: ...
def prepare_star(next: _next, token: _token) -> _callback: ...
def prepare_self(next: _next, token: _token) -> _callback: ...

View File

@@ -9,7 +9,7 @@ VERSION = ... # type: str
class ParseError(SyntaxError): ...
def iselement(element: Element) -> bool: ...
def iselement(element: 'Element') -> bool: ...
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
@@ -20,31 +20,31 @@ class Element:
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., Element]], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, subelement: Element) -> None: ...
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, subelement: 'Element') -> None: ...
def clear(self) -> None: ...
def copy(self) -> Element: ...
def extend(self, elements: Sequence[Element]) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def copy(self) -> 'Element': ...
def extend(self, elements: Sequence['Element']) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional['Element']: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List[Element]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def insert(self, index: int, subelement: Element) -> None: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, subelement: 'Element') -> None: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def itertext(self) -> Generator[str, None, None]: ...
def keys(self) -> KeysView[AnyStr]: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> Element: ...
def remove(self, subelement: Element) -> None: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> 'Element': ...
def remove(self, subelement: 'Element') -> None: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index) -> Element: ...
def __getitem__(self, index) -> 'Element': ...
def __len__(self) -> int: ...
def __setitem__(self, index: int, element: Element) -> None: ...
def __setitem__(self, index: int, element: 'Element') -> None: ...
def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> Element: ...
def Comment(text: _str_or_bytes=...) -> Element: ...
@@ -62,7 +62,7 @@ _file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> Element: ...
def parse(self, source: _file_or_filename, parser: XMLParser=...) -> Element: ...
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
@@ -85,23 +85,23 @@ class _ListDataStream(io.BufferedIOBase):
def tostringlist(element: Element, encoding: str=..., method: str=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: XMLParser=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: XMLParser=...) -> Iterator[Tuple[str, Element]]: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: XMLParser, close_source: bool=...) -> None: ...
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def __next__(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
def XML(text: AnyStr, parser: XMLParser=...) -> Element: ...
def XMLID(text: AnyStr, parser: XMLParser=...) -> Tuple[Element, Dict[str, Element]]: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., Element]
def fromstringlist(sequence: Sequence[AnyStr], parser: XMLParser=...) -> Element: ...
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], Element]=...) -> None: ...

View File

@@ -9,10 +9,10 @@ xpath_tokenizer_re = ... # type: Pattern
_token = Tuple[str, str]
_next = Callable[[], _token]
_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]]
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ...
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
def prepare_child(next: _next, token: _token) -> _callback: ...
def prepare_star(next: _next, token: _token) -> _callback: ...
def prepare_self(next: _next, token: _token) -> _callback: ...

View File

@@ -9,7 +9,7 @@ VERSION = ... # type: str
class ParseError(SyntaxError): ...
def iselement(element: Element) -> bool: ...
def iselement(element: 'Element') -> bool: ...
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
@@ -20,31 +20,31 @@ class Element:
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., Element]], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, subelement: Element) -> None: ...
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, subelement: 'Element') -> None: ...
def clear(self) -> None: ...
def copy(self) -> Element: ...
def extend(self, elements: Sequence[Element]) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def copy(self) -> 'Element': ...
def extend(self, elements: Sequence['Element']) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional'[Element']: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List'[Element']: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List[Element]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def insert(self, index: int, subelement: Element) -> None: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, subelement: 'Element') -> None: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def itertext(self) -> Generator[str, None, None]: ...
def keys(self) -> KeysView[AnyStr]: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> Element: ...
def remove(self, subelement: Element) -> None: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> 'Element': ...
def remove(self, subelement: 'Element') -> None: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index) -> Element: ...
def __getitem__(self, index) -> 'Element': ...
def __len__(self) -> int: ...
def __setitem__(self, index: int, element: Element) -> None: ...
def __setitem__(self, index: int, element: 'Element') -> None: ...
def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> Element: ...
def Comment(text: _str_or_bytes=...) -> Element: ...
@@ -62,7 +62,7 @@ _file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> Element: ...
def parse(self, source: _file_or_filename, parser: XMLParser=...) -> Element: ...
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
@@ -85,28 +85,28 @@ class _ListDataStream(io.BufferedIOBase):
def tostringlist(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: XMLParser=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: XMLParser=...) -> Iterator[Tuple[str, Element]]: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class XMLPullParser:
def __init__(self, events: Sequence[str]=..., *, _parser: XMLParser=...) -> None: ...
def __init__(self, events: Sequence[str]=..., *, _parser: 'XMLParser'=...) -> None: ...
def feed(self, data: bytes) -> None: ...
def close(self) -> None: ...
def read_events(self) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: XMLParser, close_source: bool=...) -> None: ...
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def __next__(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
def XML(text: AnyStr, parser: XMLParser=...) -> Element: ...
def XMLID(text: AnyStr, parser: XMLParser=...) -> Tuple[Element, Dict[str, Element]]: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., Element]
def fromstringlist(sequence: Sequence[AnyStr], parser: XMLParser=...) -> Element: ...
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], Element]=...) -> None: ...

View File

@@ -9,10 +9,10 @@ xpath_tokenizer_re = ... # type: Pattern
_token = Tuple[str, str]
_next = Callable[[], _token]
_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]]
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ...
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
def prepare_child(next: _next, token: _token) -> _callback: ...
def prepare_star(next: _next, token: _token) -> _callback: ...
def prepare_self(next: _next, token: _token) -> _callback: ...

View File

@@ -9,7 +9,7 @@ VERSION = ... # type: str
class ParseError(SyntaxError): ...
def iselement(element: Element) -> bool: ...
def iselement(element: 'Element') -> bool: ...
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
@@ -20,31 +20,31 @@ class Element:
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., Element]], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, subelement: Element) -> None: ...
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> None: ...
def append(self, subelement: 'Element') -> None: ...
def clear(self) -> None: ...
def copy(self) -> Element: ...
def extend(self, elements: Sequence[Element]) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def copy(self) -> 'Element': ...
def extend(self, elements: Sequence['Element']) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional['Element']: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List[Element]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def insert(self, index: int, subelement: Element) -> None: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, subelement: 'Element') -> None: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def itertext(self) -> Generator[str, None, None]: ...
def keys(self) -> KeysView[AnyStr]: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> Element: ...
def remove(self, subelement: Element) -> None: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> 'Element': ...
def remove(self, subelement: 'Element') -> None: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index) -> Element: ...
def __getitem__(self, index) -> 'Element': ...
def __len__(self) -> int: ...
def __setitem__(self, index: int, element: Element) -> None: ...
def __setitem__(self, index: int, element: 'Element') -> None: ...
def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> Element: ...
def Comment(text: _str_or_bytes=...) -> Element: ...
@@ -62,7 +62,7 @@ _file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> Element: ...
def parse(self, source: _file_or_filename, parser: XMLParser=...) -> Element: ...
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
@@ -85,28 +85,28 @@ class _ListDataStream(io.BufferedIOBase):
def tostringlist(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: XMLParser=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: XMLParser=...) -> Iterator[Tuple[str, Element]]: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class XMLPullParser:
def __init__(self, events: Sequence[str]=..., *, _parser: XMLParser=...) -> None: ...
def __init__(self, events: Sequence[str]=..., *, _parser: 'XMLParser'=...) -> None: ...
def feed(self, data: bytes) -> None: ...
def close(self) -> None: ...
def read_events(self) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: XMLParser, close_source: bool=...) -> None: ...
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def __next__(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
def XML(text: AnyStr, parser: XMLParser=...) -> Element: ...
def XMLID(text: AnyStr, parser: XMLParser=...) -> Tuple[Element, Dict[str, Element]]: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., Element]
def fromstringlist(sequence: Sequence[AnyStr], parser: XMLParser=...) -> Element: ...
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], Element]=...) -> None: ...

View File

@@ -16,28 +16,28 @@ class _ElementInterface:
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., _ElementInterface]], attrib: Dict[AnyStr, AnyStr]) -> None: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> _ElementInterface: ...
def __init__(self, tag: Union[AnyStr, Callable[..., '_ElementInterface']], attrib: Dict[AnyStr, AnyStr]) -> None: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> '_ElementInterface': ...
def __len__(self) -> int: ...
def __getitem__(self, index: int) -> _ElementInterface: ...
def __setitem__(self, index: int, element: _ElementInterface) -> None: ...
def __getitem__(self, index: int) -> '_ElementInterface': ...
def __setitem__(self, index: int, element: '_ElementInterface') -> None: ...
def __delitem__(self, index: int) -> None: ...
def __getslice__(self, start: int, stop: int) -> Sequence[_ElementInterface]: ...
def __setslice__(self, start: int, stop: int, elements: Sequence[_ElementInterface]) -> None: ...
def __getslice__(self, start: int, stop: int) -> Sequence['_ElementInterface']: ...
def __setslice__(self, start: int, stop: int, elements: Sequence['_ElementInterface']) -> None: ...
def __delslice__(self, start: int, stop: int) -> None: ...
def append(self, element: _ElementInterface) -> None: ...
def insert(self, index: int, element: _ElementInterface) -> None: ...
def remove(self, element: _ElementInterface) -> None: ...
def getchildren(self) -> List[_ElementInterface]: ...
def find(self, path: str) -> Optional[_ElementInterface]: ...
def append(self, element: '_ElementInterface') -> None: ...
def insert(self, index: int, element: '_ElementInterface') -> None: ...
def remove(self, element: '_ElementInterface') -> None: ...
def getchildren(self) -> List['_ElementInterface']: ...
def find(self, path: str) -> Optional['_ElementInterface']: ...
def findtext(self, path: str, default: _T=...) -> Union[str, _T]: ...
def findall(self, path: str) -> List[_ElementInterface]: ...
def findall(self, path: str) -> List['_ElementInterface']: ...
def clear(self) -> None: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def keys(self) -> KeysView[AnyStr]: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[_ElementInterface]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['_ElementInterface']: ...
def Element(tag: Union[AnyStr, Callable[..., _ElementInterface]], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> _ElementInterface: ...
def SubElement(parent: _ElementInterface, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> _ElementInterface: ...
@@ -56,7 +56,7 @@ _file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: _ElementInterface=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> _ElementInterface: ...
def parse(self, source: _file_or_filename, parser: XMLTreeBuilder=...) -> _ElementInterface: ...
def parse(self, source: _file_or_filename, parser: 'XMLTreeBuilder'=...) -> _ElementInterface: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[_ElementInterface]: ...
def find(self, path: str) -> Optional[_ElementInterface]: ...
def findtext(self, path: str, default: _T=...) -> Union[_T, str]: ...
@@ -66,7 +66,7 @@ class ElementTree:
def iselement(element: _ElementInterface) -> bool: ...
def dump(elem: _ElementInterface) -> None: ...
def fixtag(tag: Union[str, QName], namespaces: Dict[str, str]) -> Tuple[str, Optional[str]]: ...
def parse(source: _file_or_filename, parser: XMLTreeBuilder=...) -> ElementTree: ...
def parse(source: _file_or_filename, parser: 'XMLTreeBuilder'=...) -> ElementTree: ...
class iterparse: