Uh oh!
There was an error while loading. Please reload this page.
Fix for Python 4 - #2078
Conversation
nicolaskruchten
commented
Jan 15, 2020
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? |
hugovk
commented
Jan 15, 2020
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. |
nicolaskruchten
commented
Jan 15, 2020
No, but I'd rather these changes be pure refactorings that don't change behaviour if possible, to avoid unintended side-effects :) |
hugovk
commented
Jan 15, 2020
Sure thing, will update tomorrow! |
nicolaskruchten
commented
Jan 15, 2020
Thanks very much for bringing this up and fixing it for us :) |
hugovk
commented
Jan 16, 2020
You're welcome, and updated: -if sys.version_info.major == 3 and sys.version_info.minor >= 3:+if sys.version_info >= (3, 3): |
Uh oh!
There was an error while loading. Please reload this page.
nicolaskruchten
commented
Jan 16, 2020
LGTM... @jonmmease@emmanuelle thoughts? |
hugovk
commented
Jan 16, 2020
As suggested in #2076 (comment), I've combined PR #2076 with this one. |
nicolaskruchten
commented
Jan 16, 2020
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! |
emmanuelle
commented
Jan 22, 2020
Thank you very much! |
hugovk
commented
Jan 22, 2020
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.