-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Modernize ArtistInspector a bit... #12038
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
Conversation
@@ -11,22 +11,6 @@ | |||
from .path import Path | |||
from .transforms import (Bbox, IdentityTransform, Transform, TransformedBbox, | |||
TransformedPatchPath, TransformedPath) | |||
# Note, matplotlib artists use the doc strings for set and get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that comment is essentially completely false now (even the magic string for aliases is "Alias for", not "alias for" :))
lib/matplotlib/artist.py
Outdated
else: | ||
return s | ||
return s + ''.join(' or %s' % x | ||
for x in sorted(self.aliasd.get(s, []))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to keep this structurally similar to alias_name_rest()
:
aliases = ''.join(' or %s' % x for x in sorted(self.aliasd.get(s, [])))
return s + aliases
Also slightly more readable.
lib/matplotlib/artist.py
Outdated
ds = o.__doc__ | ||
if ds is None: | ||
return False | ||
return ds.startswith('Alias for ') | ||
|
||
def aliased_name(self, s): | ||
""" | ||
return 'PROPNAME or alias' if *s* has an alias, else return | ||
PROPNAME. | ||
return 'PROPNAME or alias' if *s* has an alias, else return PROPNAME. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May give it a capital to start, when you're editing anyway. 😄
comments handled |
Thanks @anntzer |
PR Summary
PR Checklist