mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 12:21:27 +08:00
Let xml.dom.minidom.parse() accept files. (#5005)
The documentation says, "The parse() function can take either a filename or an open file object." (https://docs.python.org/3.8/library/xml.dom.minidom.html). The function was annotated as only accepting a str, so I added IO[Any].
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from typing import Any, Optional, Text, Union
|
||||
from typing import IO, Any, Optional, Text, Union
|
||||
from xml.sax.xmlreader import XMLReader
|
||||
|
||||
def parse(file: str, parser: Optional[XMLReader] = ..., bufsize: Optional[int] = ...): ...
|
||||
def parse(file: Union[str, IO[Any]], parser: Optional[XMLReader] = ..., bufsize: Optional[int] = ...): ...
|
||||
def parseString(string: Union[bytes, Text], parser: Optional[XMLReader] = ...): ...
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
|
||||
Reference in New Issue
Block a user