-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove commented-out code, unused imports #11272
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
|
||
tr = self._axis_artist_helper.get_axislabel_transform(self.axes) \ | ||
+ self.offset_transform | ||
|
||
self.label = AxisLabel(0, 0, "__from_axes__", | ||
color = "auto", #rcParams['axes.labelcolor'], |
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.
was likely intended as a comment? (unclear)
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.
In context, rcParams['axes.labelcolor']
was previously used as the color
argument, and later replaced by "auto"
(which IIRC does fall back to the rcParam if it needs to, but may also try other default behaviour).
So it's dead code, and if taken to be a comment it's misleading.
A lot of matplotlib predates pep8. Also, while that particular rule is good
to follow, in practice, we see a lot of misuse. It is the unfortunate
consequence of tab-completion-guided development...
…On Fri, May 18, 2018 at 11:05 PM, Zac Hatfield-Dodds < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lib/matplotlib/backends/backend_wxagg.py
<#11272 (comment)>
:
> from .backend_agg import FigureCanvasAgg
-from .backend_wx import (
- _BackendWx, _FigureCanvasWxBase, FigureFrameWx,
- NavigationToolbar2Wx as NavigationToolbar2WxAgg)
Via PEP8
<https://www.python.org/dev/peps/pep-0008/#public-and-internal-interfaces>
:
Imported names should always be considered an implementation detail. Other
modules must not rely on indirect access to such imported names unless they
are an explicitly documented part of the containing module's API
Other people "must not rely" on that working - if it becomes public API
just because they might anyway, we might as well give up now!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11272 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-BK4n3IE-iBLuaix3Kepvo4mbtKzks5tz4v1gaJpZM4UE4TH>
.
|
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.
I don't have a strong opinion on the implicit public API due to imports. This is for someone else to decide.
Apart from that the changes look reasonable.
The proper place for commented-out old code is in the version history tracked by
git
, not the current source files. As well as commented lines, I removed extra newlines where they made the spacing of code inconsistent and potentially confusing. Unused imports are a similar anti-pattern, and unpythonic.The intention is that this set of changes makes the code easier to read, and thus makes contributing to Matplotlib slightly easier.