Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

os.PathLike exists on all supported Pythons now. #12935

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 5, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Dec 5, 2018

So no need to use contraptions like getattr(os, "PathLike", ())
anymore.

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

So no need to use contraptions like `getattr(os, "PathLike", ())`
anymore.
@anntzer anntzer added this to the v3.1 milestone Dec 5, 2018
@jklymak
Copy link
Member

jklymak commented Dec 5, 2018

We should probably decide whether we want to aggressively squash anachronisms like this. I appreciate code like this can trigger peoples' sense of aesthetics, but does it help the actual code to fix it all at once? It seems this change will just wantonly break things for 3.5 users who somehow install MPL 3.1 in instances where it need not break things.

@anntzer
Copy link
Contributor Author

anntzer commented Dec 5, 2018

I'm going to update the version checks at https://github.com/matplotlib/matplotlib/blob/master/setup.py#L14 and https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/__init__.py#L106 to require 3.6+ instead of 3.5+, at which point you'll need to really do it on purpose to get mpl3.1 on py3.5...

@timhoffm
Copy link
Member

timhoffm commented Dec 5, 2018

If we decide tp drop a python version, compatibility should not be a criterion whether or not to change code. It should be clear that somehow installing MPL with that python version is prone for problems.

Pro change: Even though it might not seem much, this improves clarity and readability of the code. There are many different similar changes. In total, it makes a big difference if we keep all legacy stuff or if we clean out the code.

Contra change: These "small" changes make it harder to navigate the git history and find out when real changes happend.

Overall, I think the readablilty aspect outweights the negative effect, so +1 for removing unneccesarily complicated code.

@QuLogic QuLogic merged commit 99d8900 into matplotlib:master Dec 5, 2018
@anntzer anntzer deleted the pathlike branch December 5, 2018 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.