Skip to content

MNT: Remove unused eventson context from artist property update#31060

Merged
QuLogic merged 1 commit into
matplotlib:mainfrom
timhoffm:mnt-eventson
Feb 3, 2026
Merged

MNT: Remove unused eventson context from artist property update#31060
QuLogic merged 1 commit into
matplotlib:mainfrom
timhoffm:mnt-eventson

Conversation

@timhoffm
Copy link
Copy Markdown
Member

@timhoffm timhoffm commented Feb 2, 2026

The attribute eventson was introduced in 79aa291. While it was set on and off in various places, there has never been any code that made logic depend on its state. The attribute itself was removed in #18910, but its toggling through the context manager was overlooked there.

Fun fact: This temporary setting of eventson never had any effect, but it was maintained through several refactorings of the property update mechanism. 🤯

Note: There is another eventson in widgets.py, which is completely independent on this here, because widgets are not Artists.

The attribute `eventson` was introduced in 79aa291. While it was
set on and off in various places, there has never been any code that
made logic depend on its state. The attribute itself was removed in
matplotlib#18910, but its toggling through the context manager was overlooked
there.

Note: There is another `eventson` in widgets.py, which is completely
independent on this here, because widgets are not Artists.
Comment thread lib/matplotlib/artist.py
property name for "{prop_name}".
"""
ret = []
with cbook._setattr_cm(self, eventson=False):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff looks larger than it is. It's really just the removal of this line and unindenting the subsequent block.

@timhoffm timhoffm added this to the v3.11.0 milestone Feb 2, 2026
@QuLogic QuLogic merged commit f08ba30 into matplotlib:main Feb 3, 2026
38 of 39 checks passed
@timhoffm timhoffm deleted the mnt-eventson branch February 3, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants