mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Audit stdlib object annotations (#9519)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from _typeshed import Incomplete
|
||||
from _typeshed import Incomplete, Unused
|
||||
from typing import Any, NoReturn
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
from urllib.request import OpenerDirector
|
||||
@@ -66,7 +66,7 @@ class DOMBuilder:
|
||||
# `input` and `cnode` argtypes for `parseWithContext` are unknowable
|
||||
# as the function does nothing with them, and always raises an exception.
|
||||
# But `input` is *probably* `DOMInputSource`?
|
||||
def parseWithContext(self, input: object, cnode: object, action: Literal[1, 2, 3, 4]) -> NoReturn: ...
|
||||
def parseWithContext(self, input: Unused, cnode: Unused, action: Literal[1, 2, 3, 4]) -> NoReturn: ...
|
||||
|
||||
class DOMEntityResolver:
|
||||
def resolveEntity(self, publicId: str | None, systemId: str) -> DOMInputSource: ...
|
||||
@@ -86,9 +86,8 @@ class DOMBuilderFilter:
|
||||
FILTER_SKIP: Literal[3]
|
||||
FILTER_INTERRUPT: Literal[4]
|
||||
whatToShow: int
|
||||
# The argtypes for acceptNode and startContainer appear to be irrelevant.
|
||||
def acceptNode(self, element: object) -> Literal[1]: ...
|
||||
def startContainer(self, element: object) -> Literal[1]: ...
|
||||
def acceptNode(self, element: Unused) -> Literal[1]: ...
|
||||
def startContainer(self, element: Unused) -> Literal[1]: ...
|
||||
|
||||
class DocumentLS:
|
||||
async_: bool
|
||||
@@ -97,8 +96,8 @@ class DocumentLS:
|
||||
# so the argtypes of `uri` and `source` are unknowable.
|
||||
# `source` is *probably* `DOMInputSource`?
|
||||
# `uri` is *probably* a str? (see DOMBuilder.parseURI())
|
||||
def load(self, uri: object) -> NoReturn: ...
|
||||
def loadXML(self, source: object) -> NoReturn: ...
|
||||
def load(self, uri: Unused) -> NoReturn: ...
|
||||
def loadXML(self, source: Unused) -> NoReturn: ...
|
||||
def saveXML(self, snode: Node | None) -> str: ...
|
||||
|
||||
class DOMImplementationLS:
|
||||
|
||||
Reference in New Issue
Block a user