If you’re curious, you could then try to convert this code that you just brought to Python 3 back to Python 2. Using3to2you’d obtain this:https://gist.github.com/berdario/cbccaf7f36d61840e0ed. In which the only change that had to be applied manually is.encode('utf-8')at line...
In addition to the 2to3 tool that allows 3.x code to be generated from 2.x source code, there's also the3to2tool, which aims to convert 3.x code back to 2.x code. In theory, this should work even better than going the other direction, since 3.x doesn't have as many nasty co...
- bpo-18473: Fixed 2to3 and 3to2 compatible pickle mappings. Fixed ambigious reverse mappings. Added many new mappings. Import mapping is no longer applied to modules already mapped with full name mapping. - bpo-23485: select.select() is now retried automatically with the recomputed timeout ...