Closed
Description
The maxdict in matplotlib's cbook is only used in one place in Matplotlib.
matplotlib/lib/matplotlib/text.py
Line 111 in bedc202
It can probably be updated to
functools.cache
now, with some work to figure out exactly where to put the cache decorator.
@greglucas Actually, switching to lru_cache would be a bit annoying, because the caching on fontproperties must be based on hash(fontproperties)
(as fontproperties themselves are mutable) but then you can't get back the fontproperties from the hash...
(Again, it may be possible to add more indirection around that but it may not really be worth it for now...)
Originally posted by @anntzer in #22271 (comment)