Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0712fd9

Browse files
authored
Merge pull request #11672 from anntzer/psfontsmapcomment
Add comment re: use of lru_cache in PsfontsMap.
2 parents 118c852 + 4082355 commit 0712fd9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/dviread.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,9 @@ class PsfontsMap(object):
812812
"""
813813
__slots__ = ('_font', '_filename')
814814

815+
# Create a filename -> PsfontsMap cache, so that calling
816+
# `PsfontsMap(filename)` with the same filename a second time immediately
817+
# returns the same object.
815818
@lru_cache()
816819
def __new__(cls, filename):
817820
self = object.__new__(cls)

0 commit comments

Comments
 (0)