Skip to content
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

Switch to argumentless (py3) super(). #10527

Merged
merged 1 commit into from Feb 19, 2018

Conversation

Projects
None yet
4 participants
@anntzer
Copy link
Contributor

commented Feb 19, 2018

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added the Py3k label Feb 19, 2018

@anntzer anntzer force-pushed the anntzer:py3super branch from ca16b65 to 45c2fd9 Feb 19, 2018

@efiring
Copy link
Member

left a comment

Looks good.

@@ -294,7 +294,7 @@ def cla(self):
ax.cla()

self._get_base_axes_attr("cla")(self)
#super(HostAxes, self).cla()
#super().cla()

This comment has been minimized.

Copy link
@efiring

efiring Feb 19, 2018

Member

This is probably a good time to delete this commented-out code.

@@ -461,7 +460,7 @@ def __init__(self, *kl, **kwargs):

axis_direction = kwargs.pop("axis_direction", "bottom")
self._axis = kwargs.pop("axis", None)
#super(AxisLabel, self).__init__(*kl, **kwargs)
#super().__init__(*kl, **kwargs)

This comment has been minimized.

Copy link
@efiring

efiring Feb 19, 2018

Member

Delete?

@anntzer anntzer force-pushed the anntzer:py3super branch 3 times, most recently from 53a03e3 to bd4607c Feb 19, 2018

@efiring

This comment has been minimized.

Copy link
Member

commented Feb 19, 2018

Two similar test failures. Here's one:

lib/mpl_toolkits/axes_grid1/parasite_axes.py:319: in twinx
    ax2.axis["left", "top", "bottom"].set_visible(False)
lib/mpl_toolkits/axes_grid1/mpl_axes.py:33: in __getitem__
    [super().__getitem__(k1) for k1 in k])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.0 = <tuple_iterator object at 0x7ff35c6d6da0>
>   [super().__getitem__(k1) for k1 in k])
E   TypeError: super(type, obj): obj must be an instance or subtype of type
lib/mpl_toolkits/axes_grid1/mpl_axes.py:33: TypeError

Looks like super() with no args doesn't work inside a list comprehension.

@anntzer anntzer force-pushed the anntzer:py3super branch from bd4607c to f32f676 Feb 19, 2018

@anntzer

This comment has been minimized.

Copy link
Contributor Author

commented Feb 19, 2018

yup, looks like __class__ is resolved in the wrong closure (sort of makes sense). fixed.

@anntzer anntzer force-pushed the anntzer:py3super branch 2 times, most recently from 8341062 to fd2bd41 Feb 19, 2018

@anntzer anntzer force-pushed the anntzer:py3super branch from fd2bd41 to 9a9f68f Feb 19, 2018

@dstansby dstansby merged commit 2e8b9f3 into matplotlib:master Feb 19, 2018

8 checks passed

ci/circleci: docs-python35 Your tests passed on CircleCI!
Details
ci/circleci: docs-python36 Your tests passed on CircleCI!
Details
codecov/patch 82.06% of diff hit (target 50%)
Details
codecov/project/library 67.05% (target 50%)
Details
codecov/project/tests 98.39% (+0%) compared to 56a6b9b
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
lgtm analysis: Python 50 new alerts
Details

@anntzer anntzer deleted the anntzer:py3super branch Feb 19, 2018

@tacaswell

This comment has been minimized.

Copy link
Member

commented Feb 19, 2018

This makes me happy 😃

@tacaswell tacaswell added this to the v3.0 milestone Feb 19, 2018

@anntzer

This comment has been minimized.

Copy link
Contributor Author

commented Feb 19, 2018

best edits are the ones that are seddable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.