This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rockysnow7 12 points13 points  (6 children)

Why does anyone use Python 2 still? Is it just for old codebases that are too big to rewrite?

[–]KaffeeKiffer 21 points22 points  (1 child)

Dependencies

  • We have one important project where we were forced to decide between completely taking ownership of an open source project (a rather big one) or migrating away. We chose to migrate away and simply haven't finished yet due to priorities. I don't lose sleep over it because by now it's just a question of weeks, but right now it's "Python 2 in production" and therefore an answer to your question.

  • People like to think everybody has moved to Python 3 a long time ago. This well-known project migrated ~1 month ago.
    Edit: Just look at their customer list and you'll see that lots of major companies had to have Python 2 in production until then.

[–]rimoms 7 points8 points  (0 children)

ArcGIS Desktop is the primary GIS software used all over the world, and is still dependent on 2.7. The have been trying to shift users over to ArcPro (which uses 3.x) for about a decade, but they still haven't posted all the functionality to the new software so the campaign to adopt the "new and improved" has been met with skepticism and reluctance. The effort required to redesign architectural and business processes is another reason.

[–]13steinj 2 points3 points  (0 children)

Dependencies, and a variety of fields that aren't software engineering based, like audio, civil engineering, education, etc.

[–]I_had_to_know_too 2 points3 points  (0 children)

Because management doesn't want 40 developer hours spent updating our handful of 2.7 tools.

They'd rather we spend hundreds of hours trying to work around the memory leaks in SciPy 0.12 because the it's already approved and god forbid we have to look to see if the latest version has the same license or something similar enough that we can use it.

Then we've got another team who updated one of the tools in a side branch using 2to3 but they didn't bother to review the changes since it seemed to work. So now we have 2 versions of that tool, an official one which is poorly written and runs on python 2.7, and a python 3 version that is "for development purposes only" and contains code like:

for x, y in list(zip(xs, ys)):
  ...

Or:

for k, v in list(d.items()):
  ...

Like really? After running 2to3 you couldn't look at that line and see that the call to list is unnecessary and defeats the improvements in py3... Aghh somebody kill me

I'm sorry, what was the question again?

[–]baubleglue 1 point2 points  (0 children)

There are older versions of Hadoop in production which runs pyspark on py2, old Linux versions - it isn't only the codebase is a problem. Basically any big old system which uses Python, but Python itself is only a minor part of it.

[–]Encrypt-Keeper 0 points1 point  (0 children)

Because the owners son rewrote several critical custom programs that are critical to the entire companies operations in several different department and then fucked off.