-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix explicit attrib defaults being overridden by inherited values #258
Conversation
653b4dd
to
5f85fe1
Compare
the rectangle must be black, not red
@@ -1320,11 +1333,25 @@ def _swap_elements(swaps: Iterable[Tuple[etree.Element, Sequence[etree.Element]] | |||
raise ValueError("Lost parent!") | |||
parent.remove(old_el) | |||
|
|||
@lru_cache(maxsize=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the unbounded cache dangerous?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, because I always call cache_clear() at the beginning of _update_etree()
https://github.com/googlefonts/picosvg/pull/258/files#diff-613582736f235e34aeab2643a59d44fb26bfa66e5bcba5f4c6fa195d74b0e7b9R1349
functools.lru_cache(None) is the same as functools.cache(), but the latter is only available for 3.9+
https://docs.python.org/3/library/functools.html#functools.cache
Fixes #224 and #257