-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Stop relying on 2to3 and use six.py
for compatibility instead
#2226
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
Conversation
And the fact that we would have a single code base which users of Python3 can actually contribute against... |
Well, I'm not sure that using |
Ok -- here it is. This is going to make some merges harder, unfortunately. Also, we should probably get #2281 (which is against 1.3.x) finished and merged with this before finalizing this. Some of these changes may be surprising, and I'll try to notate them here in this PR. |
@@ -16,6 +16,10 @@ | |||
# For some later history, see | |||
# http://thread.gmane.org/gmane.comp.python.matplotlib.devel/7068 | |||
|
|||
from __future__ import absolute_import, division, print_function, unicode_literals | |||
|
|||
import six |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking here is to always include this in every file to make moving code around easier. The things it has are "core" enough that they should probably be considered "built-ins".
Mike, |
For some of these, there are many instances of them, and I wouldn't want to comment them in each place. But perhaps a "writing portable code" document in the developer docs is in order. |
And a reference to that document in the relevant source files for the most |
Stop relying on 2to3 and use `six.py` for compatibility instead
…ters too long according to pep8. This bulk-fixes this by breaking the import up into 4 seperate lines.
…achters too long according to pep8. This bulk-fixes every file in the library.
This is a significant amount of work, but will pay off (primarily in shorter build times) in the end.