mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-21 04:57:03 +08:00
Relax type of xml.etree.ElementTree.XMLParser target argument (#4538)
The target argument can be an arbitrary object. If it has certain methods, they are used by XMLParser, missing methods are ignored. Ideally, we'd be able to type the potentially missing methods correctly, but currently the type system is unable to do so. Fixes #4537
This commit is contained in:
1 parent
dc0b4262c3
commit
87b758b0da
1 file changed
+4
-4
@@ -363,14 +363,14 @@ if sys.version_info >= (3, 8):
|
||||
|
||||
class XMLParser:
|
||||
parser: Any
|
||||
target: TreeBuilder
|
||||
target: Any
|
||||
# TODO-what is entity used for???
|
||||
entity: Any
|
||||
version: str
|
||||
if sys.version_info >= (3, 8):
|
||||
def __init__(self, *, target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ...
|
||||
def __init__(self, *, target: Any = ..., encoding: Optional[str] = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, html: int = ..., target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ...
|
||||
def __init__(self, html: int = ..., target: Any = ..., encoding: Optional[str] = ...) -> None: ...
|
||||
def doctype(self, __name: str, __pubid: str, __system: str) -> None: ...
|
||||
def close(self) -> Element: ...
|
||||
def close(self) -> Any: ...
|
||||
def feed(self, __data: _parser_input_type) -> None: ...
|
||||
Reference in new issue
Block a user