mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-27 22:31:12 +08:00
HTMLParser: Add missing stubs for attributes and methods (#6658)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
import sys
|
||||
from typing import NoReturn
|
||||
|
||||
class ParserBase:
|
||||
def __init__(self) -> None: ...
|
||||
def error(self, message: str) -> None: ...
|
||||
def reset(self) -> None: ...
|
||||
def getpos(self) -> tuple[int, int]: ...
|
||||
def unknown_decl(self, data: str) -> None: ...
|
||||
def parse_comment(self, i: int, report: int = ...) -> int: ... # undocumented
|
||||
def parse_declaration(self, i: int) -> int: ... # undocumented
|
||||
def parse_marked_section(self, i: int, report: int = ...) -> int: ... # undocumented
|
||||
def updatepos(self, i: int, j: int) -> int: ... # undocumented
|
||||
if sys.version_info < (3, 10):
|
||||
# Removed from ParserBase: https://bugs.python.org/issue31844
|
||||
def error(self, message: str) -> NoReturn: ... # undocumented
|
||||
lineno: int # undocumented
|
||||
offset: int # undocumented
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _markupbase import ParserBase
|
||||
from typing import Tuple
|
||||
from typing import Pattern, Tuple
|
||||
|
||||
class HTMLParser(ParserBase):
|
||||
def __init__(self, *, convert_charrefs: bool = ...) -> None: ...
|
||||
@@ -28,3 +28,8 @@ class HTMLParser(ParserBase):
|
||||
def parse_pi(self, i: int) -> int: ... # undocumented
|
||||
def parse_starttag(self, i: int) -> int: ... # undocumented
|
||||
def set_cdata_mode(self, elem: str) -> None: ... # undocumented
|
||||
rawdata: str # undocumented
|
||||
cdata_elem: str | None # undocumented
|
||||
convert_charrefs: bool # undocumented
|
||||
interesting: Pattern[str] # undocumented
|
||||
lasttag: str # undocumented
|
||||
|
||||
Reference in New Issue
Block a user