mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-26 05:41:11 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
|
||||
@@ -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): ...
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user