From dd66c35e0407cbb1544496837f4546ccbb783025 Mon Sep 17 00:00:00 2001 From: donBarbos Date: Thu, 7 Aug 2025 17:55:20 +0400 Subject: [PATCH 1/3] [html] Reflect parser backports Backports for PR https://github.com/python/cpython/pull/135310 were merged including 3.12 branch --- stdlib/html/parser.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/html/parser.pyi b/stdlib/html/parser.pyi index 45336f03aaa7..ba18e59249cb 100644 --- a/stdlib/html/parser.pyi +++ b/stdlib/html/parser.pyi @@ -7,7 +7,7 @@ __all__ = ["HTMLParser"] class HTMLParser(ParserBase): CDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]] - if sys.version_info >= (3, 14): + if sys.version_info >= (3, 12): RCDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]] def __init__(self, *, convert_charrefs: bool = True) -> None: ... @@ -31,7 +31,7 @@ class HTMLParser(ParserBase): def parse_html_declaration(self, i: int) -> int: ... # undocumented def parse_pi(self, i: int) -> int: ... # undocumented def parse_starttag(self, i: int) -> int: ... # undocumented - if sys.version_info >= (3, 14): + if sys.version_info >= (3, 12): def set_cdata_mode(self, elem: str, *, escapable: bool = False) -> None: ... # undocumented else: def set_cdata_mode(self, elem: str) -> None: ... # undocumented From 30df5aba0bdbc06064756611e6c1b77b16e66ebb Mon Sep 17 00:00:00 2001 From: donBarbos Date: Thu, 7 Aug 2025 18:02:02 +0400 Subject: [PATCH 2/3] Use 3.13 --- stdlib/html/parser.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/html/parser.pyi b/stdlib/html/parser.pyi index ba18e59249cb..147ebea5431a 100644 --- a/stdlib/html/parser.pyi +++ b/stdlib/html/parser.pyi @@ -7,7 +7,7 @@ __all__ = ["HTMLParser"] class HTMLParser(ParserBase): CDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]] - if sys.version_info >= (3, 12): + if sys.version_info >= (3, 13): RCDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]] def __init__(self, *, convert_charrefs: bool = True) -> None: ... @@ -31,7 +31,7 @@ class HTMLParser(ParserBase): def parse_html_declaration(self, i: int) -> int: ... # undocumented def parse_pi(self, i: int) -> int: ... # undocumented def parse_starttag(self, i: int) -> int: ... # undocumented - if sys.version_info >= (3, 12): + if sys.version_info >= (3, 13): def set_cdata_mode(self, elem: str, *, escapable: bool = False) -> None: ... # undocumented else: def set_cdata_mode(self, elem: str) -> None: ... # undocumented From 39e625796d9f4ab7d5f9de651d4891578670eb7d Mon Sep 17 00:00:00 2001 From: donBarbos Date: Thu, 7 Aug 2025 19:28:32 +0400 Subject: [PATCH 3/3] Add suggested comments --- stdlib/html/parser.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/html/parser.pyi b/stdlib/html/parser.pyi index 147ebea5431a..8b3fce0010b7 100644 --- a/stdlib/html/parser.pyi +++ b/stdlib/html/parser.pyi @@ -8,6 +8,7 @@ __all__ = ["HTMLParser"] class HTMLParser(ParserBase): CDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]] if sys.version_info >= (3, 13): + # Added in 3.13.6 RCDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]] def __init__(self, *, convert_charrefs: bool = True) -> None: ... @@ -32,6 +33,7 @@ class HTMLParser(ParserBase): def parse_pi(self, i: int) -> int: ... # undocumented def parse_starttag(self, i: int) -> int: ... # undocumented if sys.version_info >= (3, 13): + # `escapable` parameter added in 3.13.6 def set_cdata_mode(self, elem: str, *, escapable: bool = False) -> None: ... # undocumented else: def set_cdata_mode(self, elem: str) -> None: ... # undocumented