Skip to content

Commit 1f6348d

Browse files
committed
MNT: Fix double evaluation of _LazyTickList
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.
1 parent 6404c95 commit 1f6348d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/axis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,12 +543,12 @@ def __get__(self, instance, owner):
543543
if self._major:
544544
instance.majorTicks = []
545545
tick = instance._get_tick(major=True)
546-
instance.majorTicks.append(tick)
546+
instance.majorTicks = [tick]
547547
return instance.majorTicks
548548
else:
549549
instance.minorTicks = []
550550
tick = instance._get_tick(major=False)
551-
instance.minorTicks.append(tick)
551+
instance.minorTicks = [tick]
552552
return instance.minorTicks
553553

554554

0 commit comments

Comments
 (0)