Few more fixes for issues found by testing on internal codebases (#4876)

Few unrelated (but quite obvious) fixes here.

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
This commit is contained in:
Ivan Levkivskyi
2020-12-30 17:32:14 +00:00
committed by GitHub
parent 85d6df4742
commit 4141dd1176
4 changed files with 6 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
from typing import Any, Optional
from typing import Any, Optional, Text, Union
from xml.sax.xmlreader import XMLReader
def parse(file: str, parser: Optional[XMLReader] = ..., bufsize: Optional[int] = ...): ...
def parseString(string: str, parser: Optional[XMLReader] = ...): ...
def parseString(string: Union[bytes, Text], parser: Optional[XMLReader] = ...): ...
def __getattr__(name: str) -> Any: ... # incomplete

View File

@@ -85,13 +85,13 @@ class Executor:
def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ...
# Ideally this would be a namedtuple, but mypy doesn't support generic tuple types. See #1976
class DoneAndNotDoneFutures(Sequence[_T]):
class DoneAndNotDoneFutures(Sequence[Set[Future[_T]]]):
done: Set[Future[_T]]
not_done: Set[Future[_T]]
def __new__(_cls, done: Set[Future[_T]], not_done: Set[Future[_T]]) -> DoneAndNotDoneFutures[_T]: ...
def __len__(self) -> int: ...
@overload
def __getitem__(self, i: int) -> _T: ...
def __getitem__(self, i: int) -> Set[Future[_T]]: ...
@overload
def __getitem__(self, s: slice) -> DoneAndNotDoneFutures[_T]: ...

View File

@@ -5,7 +5,7 @@ from . import util
def build_postprocessors(md, **kwargs): ...
class Postprocessor(util.Processor):
def run(self, text) -> None: ...
def run(self, text) -> Any: ...
class RawHtmlPostprocessor(Postprocessor):
def isblocklevel(self, html): ...

View File

@@ -6,7 +6,7 @@ def build_treeprocessors(md, **kwargs): ...
def isString(s): ...
class Treeprocessor(util.Processor):
def run(self, root) -> None: ...
def run(self, root) -> Optional[Any]: ...
class InlineProcessor(Treeprocessor):
inlinePatterns: Any