From 3ce5502675d3c23394b592f00234fbdfc743a7d5 Mon Sep 17 00:00:00 2001 From: Hackrrr <48645708+Hackrrr@users.noreply.github.com> Date: Sun, 15 Aug 2021 17:15:34 +0200 Subject: [PATCH] Added `str` type to modifying methods on `PageElement` (#5929) Co-authored-by: Hackrrr --- stubs/beautifulsoup4/bs4/element.pyi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stubs/beautifulsoup4/bs4/element.pyi b/stubs/beautifulsoup4/bs4/element.pyi index a5cccab48..f7d6d9c6f 100644 --- a/stubs/beautifulsoup4/bs4/element.pyi +++ b/stubs/beautifulsoup4/bs4/element.pyi @@ -50,18 +50,18 @@ class PageElement: def formatter_for_name(self, formatter: Formatter | str | _EntitySubstitution): ... nextSibling: PageElement | None previousSibling: PageElement | None - def replace_with(self: Self, replace_with: PageElement) -> Self: ... - def replaceWith(self: Self, replace_with: PageElement) -> Self: ... + def replace_with(self: Self, replace_with: PageElement | str) -> Self: ... + replaceWith = replace_with def unwrap(self: Self) -> Self: ... replace_with_children = unwrap replaceWithChildren = unwrap def wrap(self, wrap_inside: _PageElementT) -> _PageElementT: ... def extract(self: Self, _self_index: int | None = ...) -> Self: ... - def insert(self, position: int, new_child: PageElement) -> None: ... - def append(self, tag: PageElement) -> None: ... - def extend(self, tags: Iterable[PageElement]) -> None: ... - def insert_before(self, *args: PageElement) -> None: ... - def insert_after(self, *args: PageElement) -> None: ... + def insert(self, position: int, new_child: PageElement | str) -> None: ... + def append(self, tag: PageElement | str) -> None: ... + def extend(self, tags: Iterable[PageElement | str]) -> None: ... + def insert_before(self, *args: PageElement | str) -> None: ... + def insert_after(self, *args: PageElement | str) -> None: ... def find_next( self, name: _Strainable | SoupStrainer | None = ...,