diff --git a/stdlib/2and3/xml/etree/ElementTree.pyi b/stdlib/2and3/xml/etree/ElementTree.pyi index d5f64b67a96e..2f2c1a59ecca 100644 --- a/stdlib/2and3/xml/etree/ElementTree.pyi +++ b/stdlib/2and3/xml/etree/ElementTree.pyi @@ -1,6 +1,6 @@ # Stubs for xml.etree.ElementTree -from typing import Any, Callable, Dict, Generator, IO, ItemsView, Iterable, Iterator, KeysView, List, MutableSequence, Optional, overload, Sequence, Text, Tuple, TypeVar, Union +from typing import Any, Callable, Dict, Generator, IO, ItemsView, Iterable, Iterator, KeysView, List, MutableSequence, Optional, overload, Sequence, Text, Tuple, TypeVar, Union, overload import io import sys @@ -53,8 +53,14 @@ class Element(MutableSequence[Element]): 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]: ... - def findtext(self, path: _str_argument_type, default: Optional[_T] = ..., namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... - def get(self, key: _str_argument_type, default: Optional[_T] = ...) -> Union[_str_result_type, _T]: ... + @overload + def findtext(self, path: _str_argument_type, *, 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]: ... + @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): @@ -102,7 +108,10 @@ class ElementTree: def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ... 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]: ... - def findtext(self, path: _str_argument_type, default: Optional[_T] = ..., namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... + @overload + def findtext(self, path: _str_argument_type, *, 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]: ... def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... if sys.version_info >= (3, 4):