xml: fix default values, mark positional-only args (#3675)

Note xml.etree.ElementTree.TreeBuilder.start has a default value for
attrs in the C-accelerated module.
This commit is contained in:
Shantanu
2020-01-29 02:09:53 -08:00
committed by GitHub
parent 437b6947eb
commit 119547b931

View File

@@ -104,34 +104,34 @@ class Element(MutableSequence[Element]):
text: Optional[_str_result_type]
tail: Optional[_str_result_type]
def __init__(self, tag: Union[_str_argument_type, Callable[..., Element]], attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> None: ...
def append(self, subelement: Element) -> None: ...
def append(self, __subelement: Element) -> None: ...
def clear(self) -> None: ...
def copy(self) -> Element: ...
def extend(self, elements: Iterable[Element]) -> None: ...
def extend(self, __elements: Iterable[Element]) -> None: ...
def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ...
def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ...
@overload
def findtext(self, path: _str_argument_type, *, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[_str_result_type]: ...
def findtext(self, path: _str_argument_type, default: None = ..., namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[_str_result_type]: ...
@overload
def findtext(self, path: _str_argument_type, default: _T, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ...
@overload
def get(self, key: _str_argument_type) -> Optional[_str_result_type]: ...
def get(self, key: _str_argument_type, default: None = ...) -> Optional[_str_result_type]: ...
@overload
def get(self, key: _str_argument_type, default: _T) -> Union[_str_result_type, _T]: ...
def getchildren(self) -> List[Element]: ...
def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ...
if sys.version_info >= (3, 2):
def insert(self, index: int, subelement: Element) -> None: ...
def insert(self, __index: int, __subelement: Element) -> None: ...
else:
def insert(self, index: int, element: Element) -> None: ...
def insert(self, __index: int, __element: Element) -> None: ...
def items(self) -> ItemsView[_str_result_type, _str_result_type]: ...
def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ...
def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ...
def itertext(self) -> Generator[_str_result_type, None, None]: ...
def keys(self) -> KeysView[_str_result_type]: ...
def makeelement(self, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]) -> Element: ...
def remove(self, subelement: Element) -> None: ...
def set(self, key: _str_argument_type, value: _str_argument_type) -> None: ...
def makeelement(self, __tag: _str_argument_type, __attrib: Dict[_str_argument_type, _str_argument_type]) -> Element: ...
def remove(self, __subelement: Element) -> None: ...
def set(self, __key: _str_argument_type, __value: _str_argument_type) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, i: Union[int, slice]) -> None: ...
@overload
@@ -163,7 +163,7 @@ class ElementTree:
def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ...
def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ...
@overload
def findtext(self, path: _str_argument_type, *, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[_str_result_type]: ...
def findtext(self, path: _str_argument_type, default: None = ..., namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[_str_result_type]: ...
@overload
def findtext(self, path: _str_argument_type, default: _T, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ...
def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ...
@@ -224,9 +224,9 @@ _ElementFactory = Callable[[Any, Dict[Any, Any]], Element]
class TreeBuilder:
def __init__(self, element_factory: Optional[_ElementFactory] = ...) -> None: ...
def close(self) -> Element: ...
def data(self, data: _parser_input_type) -> None: ...
def start(self, tag: _parser_input_type, attrs: Dict[_parser_input_type, _parser_input_type]) -> Element: ...
def end(self, tag: _parser_input_type) -> Element: ...
def data(self, __data: _parser_input_type) -> None: ...
def start(self, __tag: _parser_input_type, __attrs: Dict[_parser_input_type, _parser_input_type]) -> Element: ...
def end(self, __tag: _parser_input_type) -> Element: ...
if sys.version_info >= (3, 8):
class C14NWriterTarget:
@@ -254,6 +254,6 @@ class XMLParser:
def __init__(self, *, target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ...
else:
def __init__(self, html: int = ..., target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ...
def doctype(self, name: str, pubid: str, system: str) -> None: ...
def doctype(self, __name: str, __pubid: str, __system: str) -> None: ...
def close(self) -> Element: ...
def feed(self, data: _parser_input_type) -> None: ...
def feed(self, __data: _parser_input_type) -> None: ...