On Fri, 22 Sep 2017 04:05 pm, Paul Rubin wrote: > Steve D'Aprano <steve+pyt...@pearwood.info> writes: >> Having to spend a few hours being paid to migrate code using "print x" >> to "print(x)", or even a few months, is not a life-changing experience. > > Didn't someone further up the thread mention some company that had spent > 1.5 years porting a py2 codebase to py3?
Its possible, but if so I missed it. And did I mention one of the coders at the company I work, who decided to port our Python 2 code base to Python 3? He stayed behind one night after hours and did it in three hours. We've been talking about it for about two years. What are we to make of anecdotes like these? Apart from the possibility that one, or the other, or both, is an exaggeration or lie[1]? - perhaps one code base is bigger than the other; - perhaps one is an unspeakable mess, and the other is nice clean code; - perhaps one has masses of unit tests while the other barely even works; - perhaps one company has good coders and the other has terrible coders; - perhaps it was 1.5 years elapsed time, ten days effort (I've worked with people like that). Who can say? 95% of Python is unchanged from Python 2 to 3. 95% of the remaining is a trivial renaming or other change which can be mechanically translated using a tool like 2to3. Only the remaining 5% of 5% is actually tricky to migrate. If your code base is full of things relying on that 5% of 5%, then you'll struggle. Otherwise, is probably much easier than people expect. [1] I admit it: mine was an exaggeration. It actually took him four hours. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/python-list