From 4e52cf1b716101f49d89d453209620d7ccefeb0c Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 29 Apr 2023 07:54:09 -0700 Subject: [PATCH] bs4: NavigableString accepts ReadableBuffer (#10106) It delegates to str.__new__. --- stubs/beautifulsoup4/bs4/element.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/beautifulsoup4/bs4/element.pyi b/stubs/beautifulsoup4/bs4/element.pyi index 8fc9681b7..aa1e01015 100644 --- a/stubs/beautifulsoup4/bs4/element.pyi +++ b/stubs/beautifulsoup4/bs4/element.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, ReadableBuffer from collections.abc import Callable, Iterable, Iterator from re import Pattern from typing import Any, Generic, TypeVar, overload @@ -182,7 +182,7 @@ class NavigableString(str, PageElement): PREFIX: str SUFFIX: str known_xml: bool | None - def __new__(cls, value: str | bytes) -> Self: ... + def __new__(cls, value: str | ReadableBuffer) -> Self: ... def __copy__(self) -> Self: ... def __getnewargs__(self) -> tuple[str]: ... def output_ready(self, formatter: Formatter | str | None = "minimal") -> str: ...