Skip to content

Deprecate/remove maxdict #22278

Closed
Closed
@greglucas

Description

@greglucas

The maxdict in matplotlib's cbook is only used in one place in Matplotlib.

_cached = cbook.maxdict(50)

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions