From 21be9ecda610cfc784b5007d739f910ac0ca591d Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Fri, 24 Nov 2023 17:06:02 +0100 Subject: [PATCH 1/2] _Attrib.get, mark the default argument as optional --- lxml-stubs/etree.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxml-stubs/etree.pyi b/lxml-stubs/etree.pyi index ed2356c..0a899bb 100644 --- a/lxml-stubs/etree.pyi +++ b/lxml-stubs/etree.pyi @@ -318,7 +318,7 @@ 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]: ... + def get(self, key: _AnyStr, default: Optional[_AnyStr] = ...) -> Optional[_AnyStr]: ... def keys(self) -> _ListAnyStr: ... def __iter__(self) -> Iterator[_AnyStr]: ... # actually _AttribIterator def iterkeys(self) -> Iterator[_AnyStr]: ... From 9483d2fa949ecf9421cbed81645d5ac85118dd24 Mon Sep 17 00:00:00 2001 From: scoder Date: Tue, 2 Jan 2024 17:02:09 +0100 Subject: [PATCH 2/2] Fix formatting --- lxml-stubs/etree.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lxml-stubs/etree.pyi b/lxml-stubs/etree.pyi index 0a899bb..f182d67 100644 --- a/lxml-stubs/etree.pyi +++ b/lxml-stubs/etree.pyi @@ -318,7 +318,9 @@ class _Attrib: def __getitem__(self, key: _AnyStr) -> _AnyStr: ... def __bool__(self) -> bool: ... def __len__(self) -> int: ... - def get(self, key: _AnyStr, default: Optional[_AnyStr] = ...) -> Optional[_AnyStr]: ... + def get( + self, key: _AnyStr, default: Optional[_AnyStr] = ... + ) -> Optional[_AnyStr]: ... def keys(self) -> _ListAnyStr: ... def __iter__(self) -> Iterator[_AnyStr]: ... # actually _AttribIterator def iterkeys(self) -> Iterator[_AnyStr]: ...