Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT: cleanup compat.py3k.py #15011

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
Jan 17, 2020
Merged

Conversation

hmaarrfk
Copy link
Contributor

Supersedes #14093

Cleanups many if statements for python>=3.5

cc: @eric-wieser

@eric-wieser
Copy link
Member

Probably worth updating the docstring at the top to indicate that:

  • while numpy no longer supports python 2, downstream projects may still be using these shims
  • the file is also needed for features that appeared in a later python 3

@eric-wieser eric-wieser requested a review from charris November 29, 2019 19:14
@hmaarrfk hmaarrfk force-pushed the compat_cleanup_35 branch 2 times, most recently from aab4517 to fda43db Compare November 29, 2019 19:38
@charris
Copy link
Member

charris commented Nov 29, 2019

while numpy no longer supports python 2, downstream projects may still be using these shims

That would be my main concern. I haven't checked this PR, but none of the functions currently available for Python3 should disappear. We are also waiting for 1.19 development to start before doing Python2.7 cleanups, there are other pending PRs making a start on that. Note that internal cleanups are less problematical than changes to the public API.

@charris charris added this to the 1.19.0 release milestone Nov 29, 2019
@charris charris changed the title MNT: cleanup compat.py3k.py MAINT: cleanup compat.py3k.py Nov 29, 2019
@hmaarrfk
Copy link
Contributor Author

Note that internal cleanups are less problematical than changes to the public API.

This PR has been restricted to strictly internal cleanups, and the should not affect the public facing API at all. That said, it does fall in the realm of 2.7 cleanups, which are good to wait on.

Comment on lines 1 to 12
"""
Python 3 compatibility tools.
Python 3.X compatibility tools.

"""
from __future__ import division, absolute_import, print_function
While this file was originally intented for Python 2 -> 3 transition,
it is now used to create a compatibility layer between different
minor versions of Python 3.

While the active version of numpy may not support a given version of python, we
allow downstream libraries to continue to use these shims for forward
compatibility with numpy while they transition their code to newer versions of
Python.
"""
Copy link
Member

Choose a reason for hiding this comment

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

Great comment, thanks - to the extent that I'd consider merging a PR with only this change in for 1.18.0, if it's worth your time to rebase.

@hmaarrfk hmaarrfk force-pushed the compat_cleanup_35 branch 2 times, most recently from 269cdf2 to 9285702 Compare November 29, 2019 22:04
@jarrodmillman
Copy link
Member

@hmaarrfk It is finally time for 2.7 cleanups! Would you mind rebasing on master?

@hmaarrfk
Copy link
Contributor Author

hmaarrfk commented Jan 3, 2020

done ;)

@seberg
Copy link
Member

seberg commented Jan 17, 2020

Seems this has been finished for a while. Thanks, I will merge before we get conflicts with @sethtroisi work.

@seberg seberg merged commit 5e57e87 into numpy:master Jan 17, 2020
@hmaarrfk
Copy link
Contributor Author

thanks!

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.

5 participants