From 064bbcf20be2b22ab572b5b3cf7ba4cefe2296b8 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 24 Sep 2013 11:03:24 -0400 Subject: [PATCH 1/2] Hide the .cached member of Text so it doesn't get documented. --- lib/matplotlib/text.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index ddf11901e018..c760aa2e9781 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -146,7 +146,7 @@ class Text(Artist): """ zorder = 3 - cached = maxdict(50) + _cached = maxdict(50) def __str__(self): return "Text(%g,%g,%s)" % (self._x, self._y, repr(self._text)) @@ -285,8 +285,8 @@ def _get_layout(self, renderer): of a rotated text when necessary. """ key = self.get_prop_tup() - if key in self.cached: - return self.cached[key] + if key in self._cached: + return self._cached[key] horizLayout = [] @@ -440,7 +440,7 @@ def get_text_width_height_descent(*kl, **kwargs): xs, ys = xys[:, 0], xys[:, 1] ret = bbox, zip(lines, whs, xs, ys), descent - self.cached[key] = ret + self._cached[key] = ret return ret def set_bbox(self, rectprops): From 1f0e54087a7836919ec20da9b2783479e84ddfd4 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 25 Sep 2013 09:39:28 -0400 Subject: [PATCH 2/2] Add API change note. --- doc/api/api_changes.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index cef17ecca17e..589e32211557 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -17,6 +17,16 @@ For new features that were added to matplotlib, please see Changes in 1.3.x ================ +Changes in 1.3.1 +---------------- + +It is rare that we make an API change in a bugfix release, however, +for 1.3.1 since 1.3.0 the following change was made: + +- `text.Text.cached` (used to cache font objects) has been made into a + private variable. Among the obvious encapsulation benefit, this + removes this confusing-looking member from the documentation. + Code removal ------------