In all seriousness, I had to convert a script from python 2 to 3... it took 3 line changes adding braces around print statements. I wonder what percentage of legacy Python 2 is a 30 minute code review away from python 3 compliance. It's not 100 percent, but I wouldn't be surprised if it was around a half.
Going through a 2->3 migration now... the problem we have is a bunch of internal dependencies spread across teams and it’s a cluster to unravel. My team is ahead of the curve but now we have this parallel branch that has been hanging around for 2 months and probably still will be for another 2-3 months waiting for a few things from other teams to be worked out
If I wasn't clear, I'm sure there's hard changes, but I think due to the number of python2 code out there, and the fact that short simple scripts are probably more common than deep functional code, a lot of it might just need a little developer time.
I'm new so take this question with a pound of salt.
Is the transition from python 2 to 3 easy in your case because it's all self-contained? Like... If your python 2 code utilized a bunch of libraries or stuff that maybe your team didn't even design (or fully understand), then that conversion might be impossible regardless of whether 3 new lines of code would fix it.
It really depends what you're scripts are doing, but for the most part I would imagine many scripts aren't doing anything at a deep level, but rather just some level of automation (note the script actually did a LOT, but much of the code was requests/curl commands that was portable)
Also a major thing at my studio is unit tests. We test the output of our functionality. So assuming you already had pytests for Python2, you bring those up to Python3, and they should still work, if they don't... well then you solve them.
I've found spending an extra day or two on unit tests will save you weeks or months later on. I'm lucky because our project managers trust and agree with us on that.
21
u/Kinglink Aug 20 '20
Don't ruin this for me.... Damn.
In all seriousness, I had to convert a script from python 2 to 3... it took 3 line changes adding braces around print statements. I wonder what percentage of legacy Python 2 is a 30 minute code review away from python 3 compliance. It's not 100 percent, but I wouldn't be surprised if it was around a half.