Live data from Hacker News

Why Is the Migration to Python 3 Taking So Long?

stackoverflow.blog

261–270 of 355 posts

Re: Why Is the Migration to Python 3 Taking So Long?

#261
post #48

First off. Python 2.6 and 2.7 supported Unicode just fine. I had a large all-Unicode system in Python 2.6. You had to write u'word" to get a Unicode constant, and use a "unicode(s)" function here and there. Also, the part that remained "compatible" was that "str" remained an array of bytes, even though there was also a type "bytes" and a "bytearray". Early Python 3 was hell for conversion. The syntax was changed for…

OTOH, Python screwed up so badly that modern languages now know not to call a redesign a sequel, so it's not all gloom and doom.

Re: Why Is the Migration to Python 3 Taking So Long?

#262
post #79

Earlier quoted context omitted.

Most things in a language are explicit design decisions. Doesn't automatically make them good decisions. Actually Python is one of my favorite programming languages, probably the language with the closest mapping to how I naturally think about a problem. I really like it. But I'm also willing to admit it has some warts, as does any language.

Python has warts, but IMHO it's weird to identify valid design choices, with pros and cons on each side, as "warts". If I were listing Python warts, I'd point to things like single-element tuples (1,), the `datetime` support (timezone-naive datetimes are an ambiguous disaster), or the cpython Global Interpreter Lock.

Yep, complaining about self is kinda silly when there are real things to complain about.

My editor supports snippets so moderate python boilerplate is not a problem.

Re: Why Is the Migration to Python 3 Taking So Long?

#263
post #215
post #160

Earlier quoted context omitted.

> Unicode support was actually an anti-feature for most existing code. If you're writing a simple script you prefer 'garbage-in, garbage-out' unicode rather than scattering casts everywhere to watch it randomly explode when an invalid byte sneaks in. If you did have a big user-facing application that cared about unicode, then the conversion was incredibly painful for you because you were a real user of the old style.…

> Actually that's the behavior of python 2, it works fine, until you send invalid characters then it blows up. Not always. As far as I can tell writing garbage bytes to various APIs works fine unless they explicitly try to handle encoding issues. First time I noticed encoding issues in my code was when writing an xml structure failed on windows, all because of an umlaut in an error message I couldn't care less about.…

What kind of text do you have to process at your job, that you never meet any unicode in it? Nowadays unicode is everywhere, especially with emojis. Even a simple IRC bot needs to handle that.

Re: Why Is the Migration to Python 3 Taking So Long?

#264

Earlier quoted context omitted.

This is a hugely American point of view. For anyone who has to deal with unicode on a regular basis, the better unicode support alone is a huge improvement. That's without even looking at the advantages of Async support which offers big performance benefits for web developers—roughly 70% of Python users.

Note that the question is not "Shall we support Unicode?". Clearly we should. The question is rather whether it would have been better to gradually improve support for it in a Python2-esque way, rather than creating a discontinuity and a raft of new problems, some of which linger to this day. Also, for many purposes, there is wide agreement that ASCII is still the way to go. Even if Americans vanished tomorrow, the m…

Unicode support isn't about supporting unicode in files of source code!

Re: Why Is the Migration to Python 3 Taking So Long?

#265

Earlier quoted context omitted.

This is a hugely American point of view. For anyone who has to deal with unicode on a regular basis, the better unicode support alone is a huge improvement. That's without even looking at the advantages of Async support which offers big performance benefits for web developers—roughly 70% of Python users.

Note that the question is not "Shall we support Unicode?". Clearly we should. The question is rather whether it would have been better to gradually improve support for it in a Python2-esque way, rather than creating a discontinuity and a raft of new problems, some of which linger to this day. Also, for many purposes, there is wide agreement that ASCII is still the way to go. Even if Americans vanished tomorrow, the m…

They did try to do it in Python 2 and intruded Unicode type. The problem was that not only it didn't help, it is the main reason why migration to Python 3 is so painful.

Re: Why Is the Migration to Python 3 Taking So Long?

#266
post #71

I recently went through a fairly large upgrade from JDK8 to JDK 11 and it was a bit of a pain -- lots of dependencies to update, etc. But very few code changes were required, and the static type system made it pretty clear when the codebase was broken -- it just wouldn't build. It still took my team several weeks. Migrating from Python 2 to Python 3 is way worse than that -- code changes are required, and because Pyt…

Pyflakes, unit tests, and type annotations will find the vast majority of such bugs in a large program. If you used logging instead of print it’s even easier.

Re: Why Is the Migration to Python 3 Taking So Long?

#267
post #133
post #69

Earlier quoted context omitted.

> This is backwards thinking. And the alternative is cargo cult "newer is better". > Yes, it's expensive to upgrade from Python 2 to Python 3, but it's also expensive for the Python project to maintain 2 versions of Python indefinitely. On the other hand, they could progressively enhance upon a backwards compatible single 2 version. JS manages to do that just fine, as does Java...

> On the other hand, they could progressively enhance upon a backwards compatible single 2 version. JS manages to do that just fine, as does Java... Common Lisp has a backwards compatibility which goes into decades, and implementations like SBCL had no difficulties at all to absorb Unicode. Racket even supports different language standards and completely different languages (such as Scheme and Algol) running on the s…

> It is, however, a huge problem for domains like scientific computing, where most code has no maintainers and even for very important code there is no budget or staff for maintenance

I think that's a tool selection problem, not just confined to the python world. If the language and libraries won't have a supported lifespan that matches with the maintenance budget of the projects using them then the wrong tool was chosen. If a project is expected to have a 10+ year lifespan of little to no maintenance then it needs to be built on languages/libraries that will have supported versions for that long.

Re: Why Is the Migration to Python 3 Taking So Long?

#268
post #256

The simple reason is that there was no compelling feature to reward you for upgrading. You'd spend a tremendous amount of effort for dubious return and (until recently) a smaller ecosystem. 1. Unicode support was actually an anti-feature for most existing code. If you're writing a simple script you prefer 'garbage-in, garbage-out' unicode rather than scattering casts everywhere to watch it randomly explode when an in…

I am flabbergasted every time I see a software project eschew backwards-compatibility. No one wants to spend energy re-programming to stay in place. Especially APIs.

Yes python 3 was clearly a mistake. There could have been less hostile ways to make improvements in the language.

Re: Why Is the Migration to Python 3 Taking So Long?

#269

Because they broke backward compatibility in very annoying ways without providing a fallback mechanism. I still haven't forgiven them for killing the print statement, which could have peacefully coexisted with a print() function.

Bugged me for a while five years ago. Then I moved everything to logging and use an editor snippet: pr —> print(‘foo:’, %cursor%)

Re: Why Is the Migration to Python 3 Taking So Long?

#270
post #170

Because it's not just syntactic changes, it's implied-semantic changes too. You can't mechanically transform a project and know that it'll work. And you can't do it gradually, so it's all-or-nothing. (yes, "six" exists, but you still execute one way or another) And you'll have to change the versions of all your libraries, which is not usually a smooth experience in the Python ecosystem. (this is another place where i…

You can definitely do it gradually with a few bumps but there are categories of large apps that are more difficult than average.
Post reply on HN