Yes really. Mine too. Companies have a lot of old code and there's not much incentive to upgrade it to Python 3 for basically zero benefit.
Actually, it's a big risk because these scripts are generally "tested" by using them and reporting bugs. Upgrade to Python 3 and due to its dynamic typing you're probably going to introduce a load of bugs.
Also I have noticed even some big new projects, e.g. Tensorflow, target Python 2 first and then add Python 3 support later.
The idea that the 2/3 mess is over is unfortunately not true.
While I like them, their only benefit is reducing a call of "string with idens".format(explicits_for_idens) to f"string with explicits for idens", it's syntactic sugar that saves you ".", "ormat", and the parenthesis, nothing more. And it introduces backwards incompatible in minor version numbers, which it really shouldnt.
it's syntactic sugar that saves you ".", "ormat", and the parenthesis, nothing more
I disagree. The greatest benefit of f-strings is that the save you the need to zip the values in your head. Consider this:
'a={} x={} u={} z={} y={}'.format(a, x, u, y, z)
You need to make sure that the list of {}s matches the format arguments. Compare to this:
f'a={a} x={x} u={u} z={y} y={z}'
Now that each expression is written in the place it is supposed to be formatted, we can clearly see that I've "accidentally" mixed y and z. The same mistake exists in the .format() version, but much harder to notice.
66
u/[deleted] Jun 28 '18
Yes really. Mine too. Companies have a lot of old code and there's not much incentive to upgrade it to Python 3 for basically zero benefit.
Actually, it's a big risk because these scripts are generally "tested" by using them and reporting bugs. Upgrade to Python 3 and due to its dynamic typing you're probably going to introduce a load of bugs.
Also I have noticed even some big new projects, e.g. Tensorflow, target Python 2 first and then add Python 3 support later.
The idea that the 2/3 mess is over is unfortunately not true.