bs4: Make Tag.attrs more permissive (#11487)

Make `Tag.attrs` more permissive to be in line with actual code

`Tag.attrs` is a dict can technically have `list[str]` as a valid value, not just `str`. Making the value type a union with `Any` allows `list[str]` to be valid in a type checker's eyes if a user narrows it.

Based on discussion in, and fixes, #8755.
This commit is contained in:
Thanos
2024-02-28 00:05:54 -05:00
committed by GitHub
parent 1f3cf143a5
commit 3ddcbd04b8

View File

@@ -234,7 +234,7 @@ class Tag(PageElement):
sourceline: int | None
sourcepos: int | None
known_xml: bool | None
attrs: dict[str, str]
attrs: dict[str, str | Any]
contents: list[PageElement]
hidden: bool
can_be_empty_element: bool | None