Uh oh!
There was an error while loading. Please reload this page.
gh-95813: Improve HTMLParser from the view of inheritance - #95874
Conversation
ezio-melotti
commented
Aug 11, 2022
@corona10, thanks for the PR! |
Updated! Without patch: |
diff --git a/Lib/_markupbase.py b/Lib/_markupbase.py
index 3ad7e27996..f8b2b901b9 100644
--- a/Lib/_markupbase.py+++ b/Lib/_markupbase.py@@ -7,6 +7,7 @@
import re
+from abc import ABCMeta, abstractmethod
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.compile(r'(\'[^\']*\'|"[^"]*")\s*').match
_commentclose = re.compile(r'--\s*>')
@@ -20,7 +21,7 @@
del re
-class ParserBase:+class ParserBase(metaclass=ABCMeta):
"""Parser base class which provides some common support methods used
by the SGML/HTML and XHTML parsers."""
@@ -391,6 +392,6 @@ def _scan_name(self, i, declstartpos):
"expected name token at %r" % rawdata[declstartpos:declstartpos+20]
)
- # To be overridden -- handlers for unknown objects+ @abstractmethod
def unknown_decl(self, data):
passOne more thing, what about update ParserBase as abstract class? |
corona10
commented
Aug 16, 2022
@ezio-melotti gentle ping |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bedevere-bot
commented
Aug 17, 2022
When you're done making the requested changes, leave the comment: |
There was a problem hiding this comment.
@ezio-melotti
I have made the requested changes; please review again.
ezio-melotti
commented
Aug 18, 2022
Thanks for the PR!
We could, but I don't think it's necessary. |
…on#95874) * pythongh-95813: Improve HTMLParser from the view of inheritance * pythongh-95813: Add unittest * Address code review
Uh oh!
There was an error while loading. Please reload this page.