3 ms·
> SQLAlchemy 1.4 establishes itself as the starting point for the SQLAlchemy 2.0 project, which will move fully to Python 3 Woa. How does this even work, do th
by Aachen 6y ago
> SQLAlchemy 1.4 establishes itself as the starting point for the SQLAlchemy 2.0 project, which will move fully to Python 3
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?
- pta2002 6y agoI'm assuming they just write code in a compatible way. It's not _too_ dificult, but it does add a lot of version checks everywhere. For example, you can use a lot of Python 3 features in Python 2 via the future package.
- bajsejohannes 6y agoThey will drop python 2 support completely in SQLAlchemy 2.0. That's at least how I read it.
- Aachen 6y agoOooh it's already fully python 3, they'll just drop backwards compatibility. That's a bit different...
- acdha 6y agoIt's easy to write code which runs on both Python 2 and 3 — there are tools like six which help maintain compatibility on the relocated standard library modules, and tools like futurize/modernize which will rewrite your code automatically: https://python-future.org/compatible_idioms.html 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.
- Aachen 6y agoAll the more reason to move to python 3 instead of staying on 2, hence my confusion how they still have parts running in python 2. Other replies clarified that this is about backwards compatibility, not updating code to run in python 3 at all.