Skip to content

Fix Any subclassing in beautifulsoup4 #9462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stubs/beautifulsoup4/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version = "4.11.*"
requires = ["types-html5lib"]

[tool.stubtest]
extras = ["lxml", "html5lib"]
5 changes: 3 additions & 2 deletions stubs/beautifulsoup4/bs4/builder/_html5lib.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Any

from bs4.builder import HTMLTreeBuilder
from html5lib.treebuilders import base as treebuilder_base

class HTML5TreeBuilder(HTMLTreeBuilder):
NAME: str
Expand All @@ -15,7 +16,7 @@ class HTML5TreeBuilder(HTMLTreeBuilder):
def create_treebuilder(self, namespaceHTMLElements): ...
def test_fragment_to_document(self, fragment): ...

class TreeBuilderForHtml5lib(Any): # html5lib.treebuilders.base.TreeBuilder
class TreeBuilderForHtml5lib(treebuilder_base.TreeBuilder):
soup: Any
parser: Any
store_line_numbers: Any
Expand All @@ -42,7 +43,7 @@ class AttrList:
def __getitem__(self, name): ...
def __contains__(self, name): ...

class Element(Any): # html5lib.treebuilders.base.Node
class Element(treebuilder_base.Node):
element: Any
soup: Any
namespace: Any
Expand Down