Skip to content

Commit

Permalink
attrib.get should have same overload signature as _element.get (GH-97)
Browse files Browse the repository at this point in the history
  • Loading branch information
PokkaKiyo authored Jan 8, 2024
1 parent ab0f6ab commit 432ac81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lxml-stubs/etree.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,10 @@ class _Attrib:
def __getitem__(self, key: _AnyStr) -> _AnyStr: ...
def __bool__(self) -> bool: ...
def __len__(self) -> int: ...
def get(self, key: _AnyStr, default: _AnyStr = ...) -> Optional[_AnyStr]: ...
@overload
def get(self, key: _TagName) -> Optional[str]: ...
@overload
def get(self, key: _TagName, default: _T) -> Union[str, _T]: ...
def keys(self) -> _ListAnyStr: ...
def __iter__(self) -> Iterator[_AnyStr]: ... # actually _AttribIterator
def iterkeys(self) -> Iterator[_AnyStr]: ...
Expand Down

0 comments on commit 432ac81

Please sign in to comment.