Skip to content

Deprecate public use of Formatter.pprint_val. #12924

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 1 commit into from
Dec 8, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Dec 2, 2018

It's really a helper method.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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 this to the v3.1 milestone Dec 2, 2018
return self._pprint_val(*args, **kwargs)

def _pprint_val(self, *args, **kwargs):
raise NotImplementedError
Copy link
Member

Choose a reason for hiding this comment

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

Should get a comment, what this is supposd to do and how subclasses should implement it. This info is targeted at other developers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the deprecation to each individual class, so no need for the NotImplemented base class version anymore.

@tacaswell tacaswell merged commit d72f069 into matplotlib:master Dec 8, 2018
@tacaswell
Copy link
Member

Thanks @anntzer .

This is one we should be willing to roll back if we get complaints.

@anntzer anntzer deleted the pprint_val branch December 8, 2018 19:38
@anntzer
Copy link
Contributor Author

anntzer commented Dec 8, 2018

@tacaswell Just to clarify why I deprecated these (it's not just "oh let's make them private because we can"): Right now it's quite difficult to follow the code flow in ticker code, and these pprint_val methods do not help at all as they can be inherited (so it's not even immediately clear which one you're getting) and don't have consistent semantics either. So the plan is to inline the relevant parts of the code into the callers as much as possible, to avoid having to trace back which pprint_val is being used where.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants