Re:Speed improvements in Python 3.7
by orf on Tuesday February 13, 2018 @04:45PM
(#16371091)
Have you tried the 'six' library? It does what you describe, as well as paving over many py2/py3 differences
[ Parent
| on HN ]
Re:Speed improvements in Python 3.7
by singularity2001 on Tuesday February 13, 2018 @04:47PM
(#16371102)
Tangentially heard of it. Thanks, will try.
Does it add py2 conventions to py3 or Does it add py3 conventions to py2 ?
Neither. It adds a wrapper in `six.moves` to various modules which moved between py2/3. It will not automatically fix existing code, but it does allow you to use one import line.
Neither, it just let's you write code that runs on 2 and 3 quite easily, by hiding import differences and changes to builtins. It's worth it if you are distributing code that has to run on 3 and 2, but if your upgrading your existing 2 code base it's not that great.