Fix mypy errors for Py3.1 files

This commit is contained in:
Ismail
2016-03-09 11:17:23 +00:00
parent d2461d2bcd
commit 395e0a4197
3 changed files with 8 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Union, Optional, Callable
from .ElementTree import Element
from .ElementTree import _ElementInterface
XINCLUDE = ... # type: str
XINCLUDE_INCLUDE = ... # type: str
@@ -11,9 +11,9 @@ XINCLUDE_FALLBACK = ... # type: str
class FatalIncludeError(SyntaxError): ...
def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str]=...) -> Union[str, Element]: ...
def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str]=...) -> Union[str, _ElementInterface]: ...
# TODO: loader is of type default_loader ie it takes a callable that has the
# same signature as default_loader. But default_loader has a keyword argument
# Which can't be represented using Callable...
def include(elem: Element, loader: Callable[..., Union[str, Element]]=...) -> None: ...
def include(elem: _ElementInterface, loader: Callable[..., Union[str, _ElementInterface]]=...) -> None: ...

View File

@@ -20,6 +20,6 @@ class Path:
def find(element: _ElementInterface, path: str) -> Optional[_ElementInterface]: ...
def findtext(element: Element, path: str, default: _T=...) -> Union[str, _T]: ...
def findtext(element: _ElementInterface, path: str, default: _T=...) -> Union[str, _T]: ...
def findall(element: _ElementInterface, path: str) -> List[_ElementInterface]: ...

View File

@@ -16,7 +16,7 @@ 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[..., Element]], attrib: Dict[AnyStr, AnyStr]) -> None: ...
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: ...
@@ -25,7 +25,7 @@ class _ElementInterface:
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: Element) -> 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]: ...
@@ -39,7 +39,7 @@ class _ElementInterface:
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[_ElementInterface]: ...
def Element(tag: Union[AnyStr, Callable[..., Element]], attrib: Dict[AnyStr, AnyStr]=..., **extra: Dict[str, AnyStr]) -> _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: ...
def Comment(text: _str_or_bytes=...) -> _ElementInterface: ...
def ProcessingInstruction(target: str, text: str=...) -> _ElementInterface: ...
@@ -89,7 +89,7 @@ class TreeBuilder:
def start(self, tag: AnyStr, attrs: Dict[AnyStr, AnyStr]) -> _ElementInterface: ...
def end(self, tag: AnyStr) -> _ElementInterface: ...
class XMLParser:
class XMLTreeBuilder:
# TODO-what is entity used for???
entity = ... # type: Any
def __init__(self, html: int=..., target: TreeBuilder=...) -> None: ...