Skip to content

MNT: unify code path of set, update, setp #5599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 14, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
REV: do not sort by key in Artist.update
restore old behavior
  • Loading branch information
tacaswell committed Dec 1, 2015
commit bba3ae28a0f513e0eb18247d6b587629fa10b986
13 changes: 7 additions & 6 deletions doc/api/api_changes/2015-12-01-TAC.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ The methods `matplotlib.artist.Artist.set`,
now use a common codepath to look up how to update the given artist
properties (either using the setter methods or an attribute/property).

The behavior of `matplotlib.Artist.update` is slightly changed to now
sort by key name and returns a list of the returned values from the
setter methods to avoid changing the API of
`matplotlib.Artist.set` and `matplotlib.artist.setp`.
The behavior of `matplotlib.Artist.update` is slightly changed to
returna a list of the returned values from the setter methods to avoid
Copy link
Member

Choose a reason for hiding this comment

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

returna -> return

changing the API of `matplotlib.Artist.set` and
`matplotlib.artist.setp`.

The keys passed into `matplotlib.Artist.update` are now converted to
all lower case before being processed, to match the behavior of
lower case before being processed to match the behavior of
`matplotlib.Artist.set` and `matplotlib.artist.setp`. This should not
break any user code because there are no set methods with capitals in
the names, however going forward this puts a constraint naming properties.
the names, however going forward this puts a constraint naming
Copy link
Member

Choose a reason for hiding this comment

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

constraint on naming...

Copy link
Member Author

Choose a reason for hiding this comment

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

I swear English is my native language...

properties.
2 changes: 1 addition & 1 deletion lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def _update_property(self, k, v):
self.eventson = False
try:
ret = [_update_property(self, k, v)
for k, v in sorted(props.items(), reverse=True)]
for k, v in props.items()]
finally:
self.eventson = store

Expand Down