3 ms·
Have you tried the 'six' library? It does what you describe, as well as paving over many py2/py3 differences
by orf 9y ago
Have you tried the 'six' library? It does what you describe, as well as paving over many py2/py3 differences
- singularity2001 9y agoTangentially heard of it. Thanks, will try. Does it add py2 conventions to py3 or Does it add py3 conventions to py2 ?
- viraptor 9y agoNeither. 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.
- orf 9y agoNeither, 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.