Live data from Hacker News

Why Is the Migration to Python 3 Taking So Long?

stackoverflow.blog

131–140 of 355 posts

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

#131
post #118

Earlier quoted context omitted.

I’ve seen a lot of people taking issue with the self argument. Am I crazy to actually love it as a feature? I pulled out a lot of my hairs when I first started OOP (Java) trying to gork `this`, and I remember myself thinking “why didn’t everybody just do this” when I saw how Python declare methods. And I still think that’s a good idea now. So much easier to keep my sanity than using JavaScript’s bind.

What's weird is that it's half baked def foo(self): instead of a more logical: def self.foo(): to match the calling syntax.

Wow, this is a lot more intuitive. gowld for BDFL!

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

#132
post #20
post #14

Earlier quoted context omitted.

Python 3 seems like a bit of a missed opportunity. Since they were introducing breaking changes in the first place, why didn't they go bigger? E.g. make the OOP seem less tacked on, immutable data structures, clean up inconsistencies in the standard library?

Can you describe how OOP feels tacked on? One of the major changes in Python 3 is that new-style classes are the only style of classes.

Modern Python lacks coherent design:

How do you define enums? with a superclass.

How do you define data classes? With a class decorator.

And then there's metaclasses too.

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

#133
post #69

Earlier quoted context omitted.

This is backwards thinking. 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. If someone wanted other than the core Python team wants to step up and maintain Python 2, they are free to do so, it's open source. But failing that, expecting the Python team to support the older/ less functional version of the code indefi…

> 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 same runtime. And both SBCL and Racket are compiled languages with a high-end GC which should make such things more difficult than CPython, which is purely interpreted and has a simpler GC.

But the incompatibility between Python 2 and Python 3 is perhap s only a symptom of a larger problem. The Python developers have decided that backwards compatibility is not that important any more. This is not a problem for companies like Dropbox, or small start-ups, from which 95 % will not even exist in five years on. 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:

https://blog.khinsen.net/posts/2017/11/16/a-plea-for-stabili...

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

#134
> most large organizations, outside of the hype cycle of technical news posts, move much more slowly than the press or blogs would have you think

That’s the reason I am so upset with today’s JavaScript ecosystem - things move so fast that good technology is being deprecated and changed constantly which breaks all kinds of things in other places.

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

#135
post #128
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...

Almost everyone hates both Java and Javascript.

> Almost everyone hates both Java and Javascript.

I just don't think that's true.

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

#136
post #96
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...

Both Java and Javascript are giant messes.

And yet, somehow, Python manages to be a bigger mess than than both of them combined.

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

#137

Simple. Python 3 is theoretically better but not in fact better, at least for most applications of Python.

In terms of feature-richness, I'd choose Python 3 over 2.7. Pre-3.6 it was slower, but at this point it's more memory efficient and generally faster, so it is in fact better in basically all applications.

The problem we have where I work is some very clever 2.7 code that isn't easy to redo in Python 3. For any new project I do, I use Python 3.

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

#138

Earlier quoted context omitted.

I actually find this aspect of the whole thing exciting, perhaps paradoxically. Now that Python 2 is static the runtime can become asymptotically bug-free. Meaning that, if you only change it to fix bugs (as opposed to introducing new syntax|semantics) it's going to approach perfection.

Who will do that though?

I'm making it a hobby, at least: https://lists.sr.ht/~sforman/bladders-announce/%3C2019091116...

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

#139
post #66

Earlier quoted context omitted.

You at least notice it's wrong. In Python2 sometimes 'it worked' until it broke and you had to figure out why.

See, it just broke when UTF-8 was interpreted as ASCII. It's entirely possible to treat bytes as bytes and leave encoding out of it for the vast majority of programs. If you're dealing with text editing and so on, then you know you need to be UTF-8 aware, and the broken programs would still be broken in either language. The visibility of the errors is a minor point, but I think it more appropriate that it be solved b…

> the broken programs would still be broken in either language.

You need to slap a decode anyway on reads from subprocesses in python3, and files open in Unicode mode by default. Wouldn't that fix the majority of silly UTF-8 compat bugs? Or am I missing a class of bugs that's not avoided automatically by python3 strings?

Post reply on HN