Skip to content

Commit

Permalink
Constant phases (#567)
Browse files Browse the repository at this point in the history
* Get rid of getPhases

This added a fair bit of complexity, and notable made the Phase classes
dynamically generated.

However, by doing this, we no longer include "process the
token using the rules for" phases in the debug log.

Co-authored-by: Sam Sneddon <me@gsnedders.com>
  • Loading branch information
ambv and gsnedders committed Feb 21, 2024
1 parent 82c2599 commit fd4f032
Show file tree
Hide file tree
Showing 3 changed files with 2,172 additions and 2,190 deletions.
12 changes: 0 additions & 12 deletions html5lib/_utils.py
Expand Up @@ -145,15 +145,3 @@ def moduleFactory(baseModule, *args, **kwargs):
return mod

return moduleFactory


def memoize(func):
cache = {}

def wrapped(*args, **kwargs):
key = (tuple(args), tuple(kwargs.items()))
if key not in cache:
cache[key] = func(*args, **kwargs)
return cache[key]

return wrapped

0 comments on commit fd4f032

Please sign in to comment.