From 189d1116d1161f22071af15b127856ea72b60027 Mon Sep 17 00:00:00 2001 From: James Hilton-Balfe Date: Mon, 5 Sep 2022 23:16:33 +0100 Subject: [PATCH] [bs4] More precise types for bs4.Tag.select(_one) (#8687) Co-authored-by: Jelle Zijlstra --- stubs/beautifulsoup4/bs4/element.pyi | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/stubs/beautifulsoup4/bs4/element.pyi b/stubs/beautifulsoup4/bs4/element.pyi index 3015a7759..d327d4272 100644 --- a/stubs/beautifulsoup4/bs4/element.pyi +++ b/stubs/beautifulsoup4/bs4/element.pyi @@ -329,8 +329,18 @@ class Tag(PageElement): def children(self) -> Iterable[PageElement]: ... @property def descendants(self) -> Iterable[PageElement]: ... - def select_one(self, selector: str, namespaces: Any | None = ..., **kwargs) -> Tag | None: ... - def select(self, selector: str, namespaces: Any | None = ..., limit: int | None = ..., **kwargs) -> ResultSet[Tag]: ... + def select_one( + self, selector: str, namespaces: Any | None = ..., *, flags: int = ..., custom: dict[str, str] | None = ... + ) -> Tag | None: ... + def select( + self, + selector: str, + namespaces: Any | None = ..., + limit: int | None = ..., + *, + flags: int = ..., + custom: dict[str, str] | None = ..., + ) -> ResultSet[Tag]: ... def childGenerator(self) -> Iterable[PageElement]: ... def recursiveChildGenerator(self) -> Iterable[PageElement]: ... def has_key(self, key: str) -> bool: ...