Skip to content

Remove Python 2 code from C extensions #10507

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 6 commits into from
Mar 5, 2018
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Feb 17, 2018

PR Summary

Remove a bunch of fallback code and macros that provided Python 2 compatibility in the C extensions. Note, this is based on #7853, #10426 and #10383 because I did not want to work out the conflicts later. I'm putting this out there to prevent duplicate work later.

PR Checklist

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

@QuLogic QuLogic added this to the v3.0 milestone Feb 17, 2018
Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

Have not gone over this with a fine-tooth comb, but in favor of getting this in sooner rather than later.

@QuLogic QuLogic changed the title Remove Python 2 code from C extensions WIP: Remove Python 2 code from C extensions Feb 17, 2018
@QuLogic
Copy link
Member Author

QuLogic commented Feb 17, 2018

I'm going to mark this WIP not because it is, but just so that it doesn't accidentally get merged before the other 3.

@@ -326,7 +326,6 @@ int load_tkinter_funcs(void)
* tkinter uses these symbols, and the symbols are therefore visible in the
* tkinter dynamic library (module).
*/
#if PY_MAJOR_VERSION >= 3
Copy link
Contributor

Choose a reason for hiding this comment

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

just inline the conditional stuff below?

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, will do when I next rebase.

@QuLogic QuLogic added the Py3k label Feb 18, 2018
@efiring
Copy link
Member

efiring commented Feb 25, 2018

This is now waiting only on #10426, which looks ready to go after a simple merge conflict fixup.

QuLogic added 6 commits March 4, 2018 23:16
Anything (approximately) starting with two underscores, or an underscore
and a capital letter is reserved in the C++ standard.
Python 3 always uses the new buffer protocol.
It's still not closed, but at least we can reference it later.
@QuLogic QuLogic changed the title WIP: Remove Python 2 code from C extensions Remove Python 2 code from C extensions Mar 5, 2018
@QuLogic
Copy link
Member Author

QuLogic commented Mar 5, 2018

Rebased now that everything else is merged.

@anntzer anntzer merged commit 21c4f9e into matplotlib:master Mar 5, 2018
@QuLogic QuLogic deleted the py3-c-ext branch March 5, 2018 08:23
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