Add defaults for third-party stubs E-H (#9954)

This commit is contained in:
Alex Waygood
2023-03-27 17:09:01 +01:00
committed by GitHub
parent 0c0a58f36d
commit 1cd3ae8e30
58 changed files with 509 additions and 496 deletions

View File

@@ -37,14 +37,14 @@ class InfosetFilter:
replaceCache: Any
def __init__(
self,
dropXmlnsLocalName: bool = ...,
dropXmlnsAttrNs: bool = ...,
preventDoubleDashComments: bool = ...,
preventDashAtCommentEnd: bool = ...,
replaceFormFeedCharacters: bool = ...,
preventSingleQuotePubid: bool = ...,
dropXmlnsLocalName: bool = False,
dropXmlnsAttrNs: bool = False,
preventDoubleDashComments: bool = False,
preventDashAtCommentEnd: bool = False,
replaceFormFeedCharacters: bool = True,
preventSingleQuotePubid: bool = False,
) -> None: ...
def coerceAttribute(self, name, namespace: Incomplete | None = ...): ...
def coerceAttribute(self, name, namespace: Incomplete | None = None): ...
def coerceElement(self, name): ...
def coerceComment(self, data): ...
def coerceCharacters(self, data): ...

View File

@@ -38,10 +38,10 @@ class HTMLUnicodeInputStream:
def openStream(self, source): ...
def position(self): ...
def char(self): ...
def readChunk(self, chunkSize: Incomplete | None = ...): ...
def readChunk(self, chunkSize: Incomplete | None = None): ...
def characterErrorsUCS4(self, data) -> None: ...
def characterErrorsUCS2(self, data) -> None: ...
def charsUntil(self, characters, opposite: bool = ...): ...
def charsUntil(self, characters, opposite: bool = False): ...
def unget(self, char) -> None: ...
class HTMLBinaryInputStream(HTMLUnicodeInputStream):
@@ -57,17 +57,17 @@ class HTMLBinaryInputStream(HTMLUnicodeInputStream):
def __init__(
self,
source,
override_encoding: Incomplete | None = ...,
transport_encoding: Incomplete | None = ...,
same_origin_parent_encoding: Incomplete | None = ...,
likely_encoding: Incomplete | None = ...,
default_encoding: str = ...,
useChardet: bool = ...,
override_encoding: Incomplete | None = None,
transport_encoding: Incomplete | None = None,
same_origin_parent_encoding: Incomplete | None = None,
likely_encoding: Incomplete | None = None,
default_encoding: str = "windows-1252",
useChardet: bool = True,
) -> None: ...
dataStream: Any
def reset(self) -> None: ...
def openStream(self, source): ...
def determineEncoding(self, chardet: bool = ...): ...
def determineEncoding(self, chardet: bool = True): ...
def changeEncoding(self, newEncoding) -> None: ...
def detectBOM(self): ...
def detectEncodingMeta(self): ...

View File

@@ -12,11 +12,11 @@ class HTMLTokenizer:
state: Any
escape: bool
currentToken: Any
def __init__(self, stream, parser: Incomplete | None = ..., **kwargs) -> None: ...
def __init__(self, stream, parser: Incomplete | None = None, **kwargs) -> None: ...
tokenQueue: Any
def __iter__(self): ...
def consumeNumberEntity(self, isHex): ...
def consumeEntity(self, allowedChar: Incomplete | None = ..., fromAttribute: bool = ...) -> None: ...
def consumeEntity(self, allowedChar: Incomplete | None = None, fromAttribute: bool = False) -> None: ...
def processEntityInAttribute(self, allowedChar) -> None: ...
def emitCurrentToken(self) -> None: ...
def dataState(self): ...

View File

@@ -4,7 +4,7 @@ from collections.abc import Mapping
from typing import Any
class Trie(Mapping[Any, Any], metaclass=ABCMeta):
def keys(self, prefix: Incomplete | None = ...): ...
def keys(self, prefix: Incomplete | None = None): ...
def has_keys_with_prefix(self, prefix): ...
def longest_prefix(self, prefix): ...
def longest_prefix_item(self, prefix): ...

View File

@@ -8,5 +8,5 @@ class Trie(ABCTrie):
def __len__(self) -> int: ...
def __iter__(self): ...
def __getitem__(self, key): ...
def keys(self, prefix: Incomplete | None = ...): ...
def keys(self, prefix: Incomplete | None = None): ...
def has_keys_with_prefix(self, prefix): ...

View File

@@ -6,9 +6,9 @@ supports_lone_surrogates: bool
class MethodDispatcher(dict[Any, Any]):
default: Any
def __init__(self, items=...) -> None: ...
def __init__(self, items=()) -> None: ...
def __getitem__(self, key): ...
def __get__(self, instance, owner: Incomplete | None = ...): ...
def __get__(self, instance, owner: Incomplete | None = None): ...
class BoundMethodDispatcher(Mapping[Any, Any]):
instance: Any

View File

@@ -4,5 +4,5 @@ from . import base
class Filter(base.Filter):
require_matching_tags: Any
def __init__(self, source, require_matching_tags: bool = ...) -> None: ...
def __init__(self, source, require_matching_tags: bool = True) -> None: ...
def __iter__(self): ...

View File

@@ -6,15 +6,15 @@ from xml.etree.ElementTree import Element
@overload
def parse(
doc: str | bytes | SupportsRead[str] | SupportsRead[bytes],
treebuilder: Literal["etree"] = ...,
namespaceHTMLElements: bool = ...,
treebuilder: Literal["etree"] = "etree",
namespaceHTMLElements: bool = True,
**kwargs,
) -> Element: ...
@overload
def parse(
doc: str | bytes | SupportsRead[str] | SupportsRead[bytes], treebuilder: str, namespaceHTMLElements: bool = ..., **kwargs
doc: str | bytes | SupportsRead[str] | SupportsRead[bytes], treebuilder: str, namespaceHTMLElements: bool = True, **kwargs
): ...
def parseFragment(doc, container: str = ..., treebuilder: str = ..., namespaceHTMLElements: bool = ..., **kwargs): ...
def parseFragment(doc, container: str = "div", treebuilder: str = "etree", namespaceHTMLElements: bool = True, **kwargs): ...
def method_decorator_metaclass(function): ...
class HTMLParser:
@@ -23,7 +23,7 @@ class HTMLParser:
errors: Any
phases: Any
def __init__(
self, tree: Incomplete | None = ..., strict: bool = ..., namespaceHTMLElements: bool = ..., debug: bool = ...
self, tree: Incomplete | None = None, strict: bool = False, namespaceHTMLElements: bool = True, debug: bool = False
) -> None: ...
firstStartTag: bool
log: Any
@@ -41,7 +41,7 @@ class HTMLParser:
def mainLoop(self) -> None: ...
def parse(self, stream, scripting: bool = ..., **kwargs): ...
def parseFragment(self, stream, *args, **kwargs): ...
def parseError(self, errorcode: str = ..., datavars: Incomplete | None = ...) -> None: ...
def parseError(self, errorcode: str = "XXX-undefined-error", datavars: Incomplete | None = None) -> None: ...
def adjustMathMLAttributes(self, token) -> None: ...
def adjustSVGAttributes(self, token) -> None: ...
def adjustForeignAttributes(self, token) -> None: ...
@@ -52,6 +52,6 @@ class HTMLParser:
def getPhases(debug): ...
def adjust_attributes(token, replacements) -> None: ...
def impliedTagToken(name, type: str = ..., attributes: Incomplete | None = ..., selfClosing: bool = ...): ...
def impliedTagToken(name, type: str = "EndTag", attributes: Incomplete | None = None, selfClosing: bool = False): ...
class ParseError(Exception): ...

View File

@@ -3,7 +3,7 @@ from typing import Any, overload
def htmlentityreplace_errors(exc: Exception) -> tuple[str | bytes, int]: ...
@overload
def serialize(input, tree: str = ..., encoding: None = ..., **serializer_opts) -> str: ...
def serialize(input, tree: str = "etree", encoding: None = None, **serializer_opts) -> str: ...
@overload
def serialize(input, tree: str, encoding: str, **serializer_opts) -> bytes: ...
@overload
@@ -31,8 +31,8 @@ class HTMLSerializer:
def encode(self, string): ...
def encodeStrict(self, string): ...
encoding: Any
def serialize(self, treewalker, encoding: Incomplete | None = ...) -> None: ...
def render(self, treewalker, encoding: Incomplete | None = ...): ...
def serializeError(self, data: str = ...) -> None: ...
def serialize(self, treewalker, encoding: Incomplete | None = None) -> None: ...
def render(self, treewalker, encoding: Incomplete | None = None): ...
def serializeError(self, data: str = "XXX ERROR MESSAGE NEEDED") -> None: ...
class SerializeError(Exception): ...

View File

@@ -3,4 +3,4 @@ from typing import Any
treeBuilderCache: Any
def getTreeBuilder(treeType, implementation: Incomplete | None = ..., **kwargs): ...
def getTreeBuilder(treeType, implementation: Incomplete | None = None, **kwargs): ...

View File

@@ -12,7 +12,7 @@ class Node:
childNodes: Any
def __init__(self, name) -> None: ...
def appendChild(self, node) -> None: ...
def insertText(self, data, insertBefore: Incomplete | None = ...) -> None: ...
def insertText(self, data, insertBefore: Incomplete | None = None) -> None: ...
def insertBefore(self, node, refNode) -> None: ...
def removeChild(self, node) -> None: ...
def reparentChildren(self, newParent) -> None: ...
@@ -38,19 +38,19 @@ class TreeBuilder:
insertFromTable: bool
document: Any
def reset(self) -> None: ...
def elementInScope(self, target, variant: Incomplete | None = ...): ...
def elementInScope(self, target, variant: Incomplete | None = None): ...
def reconstructActiveFormattingElements(self) -> None: ...
def clearActiveFormattingElements(self) -> None: ...
def elementInActiveFormattingElements(self, name): ...
def insertRoot(self, token) -> None: ...
def insertDoctype(self, token) -> None: ...
def insertComment(self, token, parent: Incomplete | None = ...) -> None: ...
def insertComment(self, token, parent: Incomplete | None = None) -> None: ...
def createElement(self, token): ...
def insertElementNormal(self, token): ...
def insertElementTable(self, token): ...
def insertText(self, data, parent: Incomplete | None = ...) -> None: ...
def insertText(self, data, parent: Incomplete | None = None) -> None: ...
def getTableMisnestedNodePosition(self): ...
def generateImpliedEndTags(self, exclude: Incomplete | None = ...) -> None: ...
def generateImpliedEndTags(self, exclude: Incomplete | None = None) -> None: ...
def getDocument(self): ...
def getFragment(self): ...
def testSerializer(self, node) -> None: ...

View File

@@ -2,6 +2,6 @@ from typing import Any
tag_regexp: Any
def getETreeBuilder(ElementTreeImplementation, fullTree: bool = ...): ...
def getETreeBuilder(ElementTreeImplementation, fullTree: bool = False): ...
getETreeModule: Any

View File

@@ -30,7 +30,7 @@ class TreeBuilder(base.TreeBuilder):
fragmentClass: Any
implementation: Any
namespaceHTMLElements: Any
def __init__(self, namespaceHTMLElements, fullTree: bool = ...): ...
def __init__(self, namespaceHTMLElements, fullTree: bool = False): ...
insertComment: Any
initial_comments: Any
doctype: Any
@@ -39,7 +39,7 @@ class TreeBuilder(base.TreeBuilder):
def getDocument(self): ...
def getFragment(self): ...
def insertDoctype(self, token) -> None: ...
def insertCommentInitial(self, data, parent: Incomplete | None = ...) -> None: ...
def insertCommentMain(self, data, parent: Incomplete | None = ...) -> None: ...
def insertCommentInitial(self, data, parent: Incomplete | None = None) -> None: ...
def insertCommentMain(self, data, parent: Incomplete | None = None) -> None: ...
document: Any
def insertRoot(self, token) -> None: ...

View File

@@ -1,4 +1,4 @@
from _typeshed import Incomplete
def getTreeWalker(treeType, implementation: Incomplete | None = ..., **kwargs): ...
def getTreeWalker(treeType, implementation: Incomplete | None = None, **kwargs): ...
def pprint(walker): ...

View File

@@ -14,12 +14,12 @@ class TreeWalker:
def __init__(self, tree) -> None: ...
def __iter__(self): ...
def error(self, msg): ...
def emptyTag(self, namespace, name, attrs, hasChildren: bool = ...) -> None: ...
def emptyTag(self, namespace, name, attrs, hasChildren: bool = False) -> None: ...
def startTag(self, namespace, name, attrs): ...
def endTag(self, namespace, name): ...
def text(self, data) -> None: ...
def comment(self, data): ...
def doctype(self, name, publicId: Incomplete | None = ..., systemId: Incomplete | None = ...): ...
def doctype(self, name, publicId: Incomplete | None = None, systemId: Incomplete | None = None): ...
def entity(self, name): ...
def unknown(self, nodeType): ...