Live data from Hacker News

Why Is the Migration to Python 3 Taking So Long?

stackoverflow.blog

321–330 of 355 posts

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

#321
post #231

Earlier quoted context omitted.

And yet Python is eating the world: http://pypl.github.io/PYPL.html Not that I'm implying that 'popularity' is a good measure of anything.

Then what are you implying?

Perhaps that listing all the excellent reasons for why some tech is 'better' than another does not translate into said tech being used.

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

#322
post #306

Earlier quoted context omitted.

Well, first thing is that most new code in scientific research is developed in PhD projects which last some three or maybe four years. The people who develop this do not have resources and time to maintain this code. Projects don't have a budget for that. There are projects which are very long-running (think CERN or ESO's VLT) but even there the true duration of the code usage is seldomly planned (AFAIK, ESO VLT has…

"ESO VLT has just started to transition from Tk/Tcl to Python" - they might regret this, new Tcl releases tend to take backward compatibility much more seriously than Python :-)

Yes, I've always thought that Tcl should be promoted as an archival quality programming language.

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

#323
post #319

Earlier quoted context omitted.

Agree totally. I had to climb the painful learning curve of psql because none of the front ends worked the way I wanted for some reason or another. Of course, having learned psql, I'm now scathing of anyone wanting a front end... hmm... maybe that's why ;)

I was actually thinking about the lack of SQL alternatives using the postgres engine; for example, why is datalog not simply available as an extension? Or MySQL syntax? PG implements a wide array of alternatives to PL/pgSQL (including standard programming languages eg python), but for whatever reason these SQL-alts never seem to consider being layered on top of the postgres engine. However, the lack of GUI frontends…

true, why isn't there a MongoDb alternative that just wraps jsonb on Postgres?

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

#324
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.

The thing is that that doesn't really match the calling syntax, it matches the syntactic sugar for the calling syntax. Whenever you do

    thing_instance.foo(bar, baz)
you're secretly calling

    Thing.foo(thing_instance, bar, baz)
Which succinctly explains where the self argument comes from.

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

#325

Earlier quoted context omitted.

Behold the tremendous amount of effort for Mercurial: https://www.mercurial-scm.org/repo/hg/log?rev=py3&revcount=2... They've been porting hg into Python 3 for the last 10 years and are only now nearing completion. I've written a bit more about this in Lobsters: https://lobste.rs/s/3vkmm8/why_i_can_t_remove_python_2_from_...

Honest question, how can it possibly take 10 years to port hg to Python 3? If I am to believe the Wikipedia source for the first release of Mercurial[0], it would've been only 4 years old at the start of the 10 year porting process. How on earth does it take 10 years to port 4 year old software? Even taking into account the fact that new features were still being added and not all focus was on porting, this doesn't r…

Please follow the links to answer your questions. That should help.

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

#326
post #204

Earlier quoted context omitted.

> In python 3 it always blows up when you mix bytes with text so you can catch the issue early on. This is definitely the case. I've been wrestling with bytes and strings all the time during the port of a Django application to Python 3 for a costumer. I can see myself encoding and decoding response bodies and JSON for the time being. For reasons I didn't investigate I don't have to do that with projects in Ruby and E…

you don't have to do these things in python 3 either, your problem was that you had python 2 code that was already broken and you are started adding encode/decode to fix it, typically making the problem worse. If you write code in python 3 from the start you rarely need to use encode() and decode(). Typically what you always want is a text not bytes. Exception to it might be places where you want to serialize like IO…

The problem are external APIs returning whatever they want no matter what they should return. The world is messy.

Example, I just had to write this

  return urllib.request
    .urlopen(url, timeout=60)  
    .read()
    .decode("utf-8", errors="backslashreplace")
(probably not valid code because of the newlines but you'll forgive me) Then I use that string in a regexp, etc.

This is the only language where I have to explicitly deal with encodings at such low level. I don't feel like I want to use it for my pet projects.

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

#327

Earlier quoted context omitted.

It's not so much that it's "hard", but that it's time consuming when you have hundreds or even thousands of python scripts to port -- and since those scripts already work and you probably weren't going to have to touch them at all, you're not really gaining anything for all of that porting effort.

Maybe whomever should have stopped writing new ones by 2009 a decade ago. Then you wouldn't have much to port.

If you'd have been writing python a decade ago, you'd know why people couldn't transition immediately to Python 3 even if they wanted to. I no longer work for the company that has hundreds of Python scripts left to migrate, but I don't think all of libraries needed (including some API libraries from vendors) were ported to python3 until a few years ago.

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

#328

Earlier quoted context omitted.

Because of the amount of work involved in porting my existing Python code. Python 3 doesn't offer any advantages that matter to me, so that's a lot of effort for little gain.

OK, thanks. Good luck with the bug fixing ;)

I'm not really worried about bugs, because the code I have works well, and I doubt I'm going to do any serious new Python 2 development.

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

#329

Earlier quoted context omitted.

OK, thanks. Good luck with the bug fixing ;)

I'm not really worried about bugs, because the code I have works well, and I doubt I'm going to do any serious new Python 2 development.

I meant the bugs in your dependencies that you'll have to backport fixes to. But hey, if you're writing bug-free code that'll be easy ;)

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

#330

Earlier quoted context omitted.

I'm not really worried about bugs, because the code I have works well, and I doubt I'm going to do any serious new Python 2 development.

I meant the bugs in your dependencies that you'll have to backport fixes to. But hey, if you're writing bug-free code that'll be easy ;)

I understood what you meant. What I'm saying is that my existing code works fine, so whatever bugs are in the dependencies are ones that don't affect me. Should I make a code change that surfaces one, then I have the means to deal with it -- but that is almost certainly going to be a rare event, as my Python projects are stable and aren't going to see much change.

I wasn't commenting on how buggy my own code is. Which version of a language I'm using doesn't really affect that variable.

Post reply on HN