mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-16 02:51:28 +08:00
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:
1 parent
1f3cf143a5
commit
3ddcbd04b8
1 file changed
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user