Skip to content

Commit 52121ff

Browse files
committed
Changed HTMLTokenizer and HTMLInputStream to be old-style classes (improves overall parse performance by 15-20%).
(It seems unlikely that anyone will be depending on the new-style class semantics here.) --HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401235
1 parent 2a332b9 commit 52121ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/html5lib/inputstream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Cache for charsUntil()
1919
charsUntilRegEx = {}
2020

21-
class HTMLInputStream(object):
21+
class HTMLInputStream:
2222
"""Provides a unicode stream of characters to the HTMLTokenizer.
2323
2424
This class takes care of character encoding and removing or replacing

src/html5lib/tokenizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
for e in entities:
2222
entitiesByFirstChar.setdefault(e[0], []).append(e)
2323

24-
class HTMLTokenizer(object):
24+
class HTMLTokenizer:
2525
""" This class takes care of tokenizing HTML.
2626
2727
* self.currentToken

0 commit comments

Comments
 (0)