-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix for Python 4 #2078
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
Fix for Python 4 #2078
Conversation
5dc49be to
096cba8
Compare
|
Thanks for this! I don't understand the following reasoning though:
-if sys.version_info.major == 3 and sys.version_info.minor >= 3: wouldn't this be a change in behaviour for 3.2? |
|
Yes, it would be a change in behaviour for 3.2. Does plotly.py still support 3.2? The classifiers at https://pypi.org/project/plotly/ suggest 2.7 and 3.3 - 3.7. |
|
No, but I'd rather these changes be pure refactorings that don't change behaviour if possible, to avoid unintended side-effects :) |
|
Sure thing, will update tomorrow! |
|
Thanks very much for bringing this up and fixing it for us :) |
096cba8 to
6432c89
Compare
|
You're welcome, and updated: -if sys.version_info.major == 3 and sys.version_info.minor >= 3:
+if sys.version_info >= (3, 3): |
|
LGTM... @jonmmease @emmanuelle thoughts? |
6432c89 to
0fd7580
Compare
|
As suggested in #2076 (comment), I've combined PR #2076 with this one. |
|
OK nice so this basically mostly impacts tests, and all the tests are passing! We'll merge this in before the 4.5 release next week unless anyone brings up any objections by then. Thanks again! |
|
Thank you very much! |
|
You're welcome! |
Python 4 is some way off, but it may be a good idea to clean some of these up, similar to #2076.
This comparison is
Truefor Python 3.3 - 3.99, but isFalsefor Python 4 and would run the Python 2 - 3.2 code:Because Python 3.3 is the minimum Python 3.x supported, it can be simplified:
Another couple of cases which fail on Python 4.0, here we need to compare the
version_infotuple and avoid comparing thesys.version_info.minorinteger:Finally, there's some code which uses
six.PY3, a bit like:Where in six.py:
When run on Python 4, this will run the Python 2 code!
Instead, use
six.PY2.Found with https://github.com/asottile/flake8-2020.