r/Python Pythonista 6d ago

News The Move to Python 3 Begins!

As someone who spent decades in the mainframe community, I find it ... humorous ... that there are legacy Python2 code bases that are only just (or have yet to consider!) moving to Python3.

https://www.eveonline.com/news/view/the-move-to-python-3-begins

298 Upvotes

106 comments sorted by

View all comments

70

u/bmrobin 6d ago

depending on the codebase, 2->3 is no joke and has so much risk

-8

u/daidoji70 6d ago

What do you mean? I migrated about 3-4 python projects from 2->3 about a decade ago and other than pandas and pandas related projects it was a breeze. Run 2to3.py and review. Barely a hiccup.

21

u/bmrobin 6d ago

i'm glad your experience was barely a hiccup. among several pitfalls i recall,

unicode being the default representation for strings, and having to migrate code that manually called `decode/encode` on text.

integer division of `1 / 3 == 0` is true in py2, and py3 it's not because it returns the float result. that had cascading effects throughout multiple layers of our stack.

5

u/Dr_Quacksworth 6d ago

I ran into very similar issues using 2to3.py