Woa. How does this even work, do they ship a py2 engine to run the old code since hosts don't have it installed anymore?
Woa. How does this even work, do they ship a py2 engine to run the old code since hosts don't have it installed anymore?
But I understand that's apparently not the intention.
Not really. It does require care (lots of constructs are off-limits) but usually you have one version check in your compat module. You may need a few others but it’s relatively rare.
https://python-future.org/compatible_idioms.html
The biggest problem now is that an increasing number of libraries dropped Python 2 support after end-of-life and so you might find that trying to support 2 in your code is fine but you need to depend on older versions of outside libraries. Most of the remaining problems tend to be cases where someone was failing to handle Unicode correctly and is blaming the required cleanup on Python 3 exposing the existing shortcomings of their code. Those problems can be harder to resolve if you have a bunch of sloppy input/output points in a codebase without good test coverage.