Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/matplotlib/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,10 @@ def parse(self, s, dpi=72, prop=None):
The results are cached, so multiple calls to `parse`
with the same expression should be fast.
"""
# lru_cache can't decorate parse() directly because the ps.useafm and
# mathtext.fontset rcParams also affect the parse (e.g. by affecting
# the glyph metrics).
# lru_cache can't decorate parse() directly because prop
# is mutable; key the cache using an internal copy (see
# text._get_text_metrics_with_cache for a similar case).
prop = prop.copy() if prop is not None else None
return self._parse_cached(s, dpi, prop)

@functools.lru_cache(50)
Expand Down