Skip to content

Commit

Permalink
MNT: Fix double evaluation of _LazyTickList
Browse files Browse the repository at this point in the history
Closes matplotlib#28908.

It seems the read-access to `instance.majorTicks` per `instance
.majorTicks.append()` still triggers the descriptor, even though
`instance.majorTicks = []` previously should have rebound the name. For
details see matplotlib#28908.
  • Loading branch information
timhoffm committed Sep 30, 2024
1 parent 6404c95 commit 1f6348d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,12 @@ def __get__(self, instance, owner):
if self._major:
instance.majorTicks = []
tick = instance._get_tick(major=True)
instance.majorTicks.append(tick)
instance.majorTicks = [tick]
return instance.majorTicks
else:
instance.minorTicks = []
tick = instance._get_tick(major=False)
instance.minorTicks.append(tick)
instance.minorTicks = [tick]
return instance.minorTicks


Expand Down

0 comments on commit 1f6348d

Please sign in to comment.