back to article For real this time, get your butt off Python 2: No updates, no nothing after 1 January 2020

Python 2 will sunset on January 1st 2020 – however, many applications have not yet upgraded to version 3, causing the coding lingo's team to mount a communications campaign to persuade devs to port their code. Python is the third most popular programming language after JavaScript and Java, according to Redmonk. Its use has …

  1. Anonymous Coward
    Anonymous Coward

    Meanwhile at $JOB, still trying to get someone to care enough to give developers to update our Django 1.3, Python 2.6 sites to Python 2.7.

    20+ developers working on building the new shiny that doesn't quite replace the old site enough to actually turn the old site off, 5 doing maintenance on the ancient sites (but actually doing feature requests on the old sites). Every 6 months we mention this is coming, no-one high up wants to turn around to the business and say "actually we need to make sure that we aren't embarrassed by using such decrepit systems, so no new development for 6 months".

    1. ArrZarr Silver badge
      Unhappy

      My god, it's like looking in a mirror.

    2. J27

      Not surprising at all. The only 2 ways I know to do this sort of thing is for it to be horribly mission critical or to divert resources away from something else and secretly work on the update.

    3. DrXym

      We still have C++ source that has to conform to Visual Studio 2008 because it needs to be cross-compiled to a shitty Windows CE device through the ARM compiler. Fortunately that device has been discontinued so we might be able to upgrade to something better.

      But its all intertia - moving to VS 2019 means upgrading all the build machines, the installer, the distributables, doing a full regression etc. And that's without changing any lines of code. To actually change the code to more modern C++ or upgrading some of the 3rd party libs is another matter again.

      1. Tom 7

        I used to do some C/C++ ISAPI stuff and after a few upgrades and changes you learn what tends to be static and what changes and try and separate them in a coherent manner. I ended up re-writing it in VB so others could help (we had 30,000 customers and 300,000 products). It then got moved to VB.Net introducing a whole new set of issues including outsourcing woo hoo!

        I still feel that, given staff with experience, a good solid C++ 'stack' would be the best way to go, with some simple API to allow others to access data in the system.

      2. bombastic bob Silver badge
        Linux

        "Fortunately that device has been discontinued so we might be able to upgrade to something better."

        Got, LInux?

        1. DrXym

          We use Linux too for another device. The software is portable but it just can't use any features found in C++11 even though we use gcc on Linux to compile it - because of the other target which doesn't do C++11. Boost papers over some of the cracks but its still an issue.

    4. bombastic bob Silver badge
      Unhappy

      "still trying to get someone to care enough to give developers to update our Django 1.3, Python 2.6 sites to Python 2.7."

      Actually using Django... (and trying to maintain it!)

      You have my pity.

    5. Glen 1

      "Django 1.3, Python 2.6 sites to Python 2.7"

      TBF a Web Application Firewall (WAF) in front of that and you're fine.

      Keep that WAF up to date though...

      1. alauddinmondal

        Django makes great software

        I am new in python. I am using Django for my crm. I found python very flexible and secure. The most amazing thing is that it is very simple with oops concept. Any developer can make any software with this great language. More one thing is very interesting with the TKINTER module. I have created a text editor with this module. Very nice. Thank you!

  2. Anonymous Coward
    Anonymous Coward

    Can you explain?

    "...AI and machine learning, for which Python is well suited."

    Can anyone doing serious AI explain this? What makes it "well suited"? I always read this without anything backing it up. With so many alternatives this isn't "C is well suited for embedded" or "Windows is well suited for games" or "UNIX is well suited for networking"... this needs to be backed up with something.

    Python does need to move on I think. Not because of anything technical as im in the dark with Python there, but just because of the simple things like print("this") become annoying when any print routine should not need such attention.

    1. werdsmith Silver badge

      Re: Can you explain?

      Possibly to do with PyTorch or Tensorflow, it seems Python has been adopted for this sort of work in research.

      1. bombastic bob Silver badge
        Devil

        Re: Can you explain?

        Let's just all admit that Python, being an interpretive lingo with the capability of c language 'things' being called by it [not necessarily efficiently, check your loops] has about the same "power" as a SHELL SCRIPT or PERL SCRIPT that's pretty much doing the *same* *thing*...

        It may be a bit more convenient for the programmer than writing a few "filter" utilities to do things in C and spit output to the shell or Perl [which is then further processed as needed] but it's really the same *kind* of thing.

        And last I checked, shell (but not so much Perl, these days) has better BACKWARDS COMPATIBILITY

        Or you COULD just write it all in 'C'... yeah not THAT hard and once you get used to it, you'll say things like "why did I EVER use Python for THAT???"

        1. DCFusor

          Re: Can you explain?

          You must be thinking of "perl 6" which is going to get a new name, Bob. Perl is the most back-compatible language I've ever used in a very long programming career. GTK has been a bigger hassle going from 2 to 3.

          The python libraries that make it easier for non adept programmers really just do all the hard work in C anyway - python just makes it easy for those sorts to use C without knowing C. Which, as you point out, can be done lots of ways. I use the Inline::LanguageOfChoice per modules on cpan for that kind of thing fairly often.

          The best - and worst - things about python -

          Whitespace and indentation - nasty syntax, but it makes copy-pasta fail, which can't be bad.

          Duck typing which is just a little different from how every other Duck typing is done, making porting hard going either direction if code does anything where that matters. ( like all the bad device drivers for raspberry pies written in python)

          Poorly designed enough for this to even be an issue. Guido should have thought ahead more.

    2. J27

      Re: Can you explain?

      I think "popular in research circles" would be a more apt description. Mostly this is due to low barrier to entry.

    3. cdegroot

      Nothing new...

      It's not well-suited - it's slow at computation and basic string processing and heavily relies on libraries to keep up appearances. But, it's easy to learn for data scientists (which are usually not full-fledged computer programmers), has a very rich ecosystem in the area, and said data scientists like the workflow that things like Jupyter bring. So it's mostly an ecosystem thing, I guess started by Google (and everybody wants to do what Google does, for some reason). To me, running Python AI/ML in production is equivalent to running Excel sheets in production. Yes, it can be done. No, you probably don't want it.

      Alternative languages (like Julia) are trying to get a foothold in the space, personally I think that Common Lisp is much better suited (certainly from a performance standpoint), but "Python in AI/ML" is a bastion that will prove very hard to capture.

      1. Morten Bjoernsvik

        Re: Nothing new...

        >It's not well-suited - it's slow at computation and basic string processing and heavily relies on libraries >to keep up appearances.

        Python has also very easy bindings to C via Cython, We had a string splicing bottleneck. Since strings in python are immutable, splicing in larger strings are something you should avoid, but the code existed, it was easier just to rewrite the module calls in C using char pointers and the speedup was around 30X.

        1. Anonymous Coward
          Anonymous Coward

          Re: Nothing new...

          Tbh , if you're going to the trouble of wtiting a python library in C for your own use then you might just as well write the whole program in C or C++ and be done with it unless there's some very specific python functionality you need that is too much work to replicate in the former.

          1. Glen 1

            Re: Nothing new...

            Possibly, but the people writing the library are not necessarily the ones who will be using it.

            1. Anonymous Coward
              Anonymous Coward

              Re: Nothing new...

              Thats why I said "for your own use".

              1. Glen 1

                Re: Nothing new...

                'Thats why I said "for your own use".'

                Which could have meant your own companies use. (I admit, it didn't in this case)

                "might just as well write the whole program in C or C++ "

                Hey Guys! Boltar is volunteering to write a full web application in C or C++! Good Luck with that.

                As i've said elsewhere:

                "I'm paying someone to solve a problem, not to give themself a blowjob over how smart they are - that's how LISP happened."

                "Sure there are times when you *want* to juggle memory addresses, but a regular CRUD app? Nah. If there are performance issues somewhere down the road, there are several layers of abstraction to peel back before I start looking at (for example) C SELECT calls. That's commonly called "premature optimisation" is is frowned upon by those with a clue."

                --

                The above poster found a bottleneck, and solved it. They didn't "build the whole thing in C or C++" with the required (expensive) level of expertise and subsequent debugging issues. The resources were spent where they were measurably needed, not self flagellating about the tradeoffs of interpreted languages.

      2. dajames

        Re: Nothing new...

        ...and heavily relies on libraries to keep up appearances.

        Methinks that's a little unfair.

        There are four approaches.

        1. Freeze the language. Never add new features or capabilities. Watch it die.

        2. Keep the language itself stable, add new features via libraries. This is what Python does.

        3. Add features to the language itself whenever you think of a new feature, making the language more complicated, less consistent, and harder to learn.

        4. Do both of 3 and 4.

        You can't always avoid language changes when implementing new features as not everything can be expressed through a library API, but keeping the language stable as much as possible strikes me as a Good Thing(TM). The changes from Python 2 to Python 3 were made largely with the aim of making the language more consistent and logical, and easier to learn and understand.

        Keeping extensions in libraries rather than mucking about with the core language helps with the "easier to learn and understand" part.

        1. Anonymous Coward
          Anonymous Coward

          Re: Nothing new...

          "3. Add features to the language itself whenever you think of a new feature, making the language more complicated, less consistent, and harder to learn."

          The C++ approach. Which has now resulted in a language with a learning curve so steep I'd be amazed if anyone new to programming bothers with it after spending more than 5 mins looking at example code. And I speak as a C++ dev.

          1. DCFusor
            Coat

            Re: Nothing new...

            Yeah, I've done C since the first implementations of it, then C++ through MFC 4.2 when I did MS stuff at all - when DevStudio hadn't been "Visual basiced up" and there was no .NOT to attempt to "enhance Java" without the lawsuits. Around the time templates and the STD library (isn't that a disease you get from sex partners of ill repute?) - I quit using the new "features" in my own code and while I still write some C++, I mostly write plain C and call that from a glue language where the glue is quicker to write, but still fast in production.

            C++ "just grew" with patches on bandaids to the point of idiocy. Other languages do that high falutin stuff far better. Fine to write, but people complain about maintaining perl? Holy cow. As Damian Conway demo'd, you can write a Turing-complete implementation in the template system that compiles to no actual code, but runs a sort with output to sdtout while you wait!

        2. Psmo
          Go

          Re: Nothing new...

          Keeping extensions in libraries rather than mucking about with the core language helps with the "easier to learn and understand" part.

          Libraries and security patches can also have been back- and forward-ported for extra securo-goodness, while the entire Python interpreter has been embedded in other products as a macro language and removing or replacing any libraries with functionality you don't want.

        3. Jamie Jones Silver badge
          Happy

          Re: Nothing new...

          4. Do both of 3 and 4.

          ERROR: * Infinite loop causing repeated execution of point 3 detected *

      3. katrinab Silver badge
        Flame

        Re: Nothing new...

        "To me, running Python AI/ML in production is equivalent to running Excel sheets in production. Yes, it can be done. No, you probably don't want it."

        Running Excel sheets in production is something that happens very frequently.

        I just love taking over someone else's spaghetti-code of Excel formulae and macros.

      4. Anonymous Coward
        Anonymous Coward

        Re: Nothing new...

        | So it's mostly an ecosystem thing, I guess started by Google

        Nope. it's a dynamic language/REPL/Right level oi strong typing/Pythonic encapsulation thing that allows engineers and scientists to be productive in their field without needing to spend too much time as a programmer. Google know a good thing when they see it...

        1. Anonymous Coward
          Anonymous Coward

          Re: Nothing new...

          "llows engineers and scientists to be productive in their field without needing to spend too much time as a programmer"

          If these scientists and engineers are writing potentially safety critical AI production code they damn well BETTER be spending time honing their coding skills! Script kiddy level stuff is not good enough.

    4. Alan Bourke

      Re: Can you explain?

      It's very structured code-wise, and syntactically simple compared to {} languages. It's kind of the reason people used to use VB6 - it gets out of the way and lets you solve the problems. Data scientists don't want to be pissing around with the scaffolding involved in using other languages.

    5. Tom 7

      Re: Can you explain?

      Python can interface to the libraries that are generally written in C++ and being dynamic you can play with things easily.

      But then you can with something like BOOST!

      Python is programmings gateway drug but there have been many gateway drugs before and the real heroin still continues to grow in C/C++.

    6. Anonymous Coward
      Anonymous Coward

      Re: Can you explain?

      python is really good cos it's interpretive so it lets you run bits of it at a time and edit it quick like *really* quickly and it's got loads of libraries and stuff that let it talk to anything like even vulkan has a python interface to it so it's super awesome to make visualisations like *instantly* the moment you get the idea with shaders but it's super simple still to understand and you can make workbooks and then show in stages how you got data and worked it through and it's like combining a paper and the code that does it all at once together it's really good and slithery like that :V

    7. SolidSquid

      Re: Can you explain?

      Easier to use than a strongly typed language, the flexibility/range in terms of libraries, the embedded tool for checking code standards (pep8), the ability to write custom C-based libraries for it where speed is a deal breaker and being able to run in a Just-In-Time compiler/environment with high levels of compatibility where C isn't an option all make it an easier sell, especially since it means you don't have to learn a different language when you want to switch the kind of project you're working on

  3. Liam Proven Silver badge

    The fork is already out there

    It's Tauthon. (Tau is the Greek letter after Pi.)

    https://github.com/naftaliharris/tauthon

    Give it some attention. It may end up being a lot of people's only hope.

    1. thosrtanner
      Boffin

      Re: The fork is already out there

      The greek letter after Pi is Rho, and after then there's Sigma before you get to Tau

      1. Julian Bradfield

        Re: The fork is already out there

        Probably the reason is that τ is 2π - there are people who think that τ is a nicer fundamental constant than π.

        1. Fazal Majid

          Re: The fork is already out there

          Those people are wrong. The fact e^iπ==-1 shows π is the fundamental one.

          1. Aquilus

            Re: The fork is already out there

            no silly cos etothei'ing is the same as rotating something complex and so e^i tau = 1 makes much more sense cos that's just saying one rotation takes you back to where you started but e^i pi = -1 tells you one half-rotation takes you to the opposite point which alright yeah ok I guess also true but weird to care about enough to prefer it to be the canonical example of the identity :V

            1. Julian Bradfield

              Re: The fork is already out there

              But e^i tau = 1 doesn't tell you so much - if e^i 2pi = 1, then you know that e^i pi is +1 or -1, but not which.

          2. Anonymous Coward
            Anonymous Coward

            Re: The fork is already out there

            @Fazal

            Grasshopper, will you walk with me?

            https://tauday.com/tau-manifesto

            1. balrog

              Re: The fork is already out there

              Oh my I was so unaware that anybody else would share my interest into why π is used when 2π is more often a useful value. I am elevated, relieved and have achieved a zen like sense of inner calm. Thank you.

          3. Brangdon

            Re: e^iπ==-1

            You don't think that the -1 is a bit clunky? e^iτ=1. See https://tauday.com/tau-manifesto:

            Geometrically, multiplying by e^iθ corresponds to rotating a complex number by an angle θ in the complex plane, which suggests a second interpretation of Euler’s identity:

            A rotation by one turn is 1.

            Since the number 1 is the multiplicative identity, the geometric meaning of e^iτ=1 is that rotating a point in the complex plane by one turn simply returns it to its original position.

            As in the case of radian angle measure, we see how natural the association is between τ and one turn of a circle. Indeed, the identification of τ with “one turn” makes Euler’s identity sound almost like a tautology.

    2. bombastic bob Silver badge
      Coat

      Re: The fork is already out there

      in Greek, 'Pi' is actually pronounced "pee"

      So it's PEEthon now?

  4. cjcox

    How very PHP of them.

    Anyway, same old problems when people "in the name of good", create a lot of pain. Well done. Well done.

    1. bombastic bob Silver badge
      Meh

      Re: How very PHP of them.

      More like "How very MICROSOFT of them".

  5. JohnFen

    Dodged a bullet

    This makes me very happy that I've never used Python for anything important.

    1. This post has been deleted by its author

      1. JohnFen

        Re: 20 years is a lot of time.

        "Then why are they still using Python 2?"

        Because they have existing code written in it, perhaps? If you have to reengineer code just because there's a new version of the language, that's a pretty large downside of using that language.

        1. doublelayer Silver badge

          Re: 20 years is a lot of time.

          But you don't have to reengineer the code if you just want to keep running it. They aren't going to secretly break all of python 2.7. They just won't update it. So it is a lot like an old operating system, as you can't get support or security updates for Windows 98.

          For the comparisons to C, try taking C code from 1975 and compiling it and running it today. Likewise, see if you can get modern C to compile with the initial C compiler. In most cases, you'll be disappointed. However, a lot of it will work. And a lot of python 2 code can be picked up, without any changes, and run in python 3. If you have a sufficiently large codebase, it's likely that some changes will be needed, but you don't have to tear down and rewrite. Could they have done the changes differently? Sure, they could have. But it would not be significantly different, because things break. Languages change. They deprecate things in their standard libraries and introduce new ones. Python is not doing something that other languages have not done.

          1. Anonymous Coward
            FAIL

            Re: 20 years is a lot of time.

            > For the comparisons to C, try taking C code from 1975 and compiling it and running it today.

            GCC can compile K&R C today. K&R C being just about as far back as you can go with C, and it still being considered C.

            You can mix K&R C with C89 or C99 in the same executable or library. It just works.

            For example, there's a lot of K&R C code in bash.

            Yeah, K&R C is from 1978. That's 41 years ago. I was playing with spaceships and aliens in 1978.

            How long did it take Python 2 to become incompatible with Python 3? 7 years?

          2. Hogbert

            Re: 20 years is a lot of time.

            Absolutely right. It's almost like the release of Python 3 was a foreshadowing of the future of the internet and social media; people chose to be outraged, and swore they would stand their ground, because no programming language upgrade should ever lose backward compatibility.

            I thought at the time, sure, they will all come round to using the new version when they realize why the improvements were made. But some of them didn't, and still refuse to. I guess they just choose to remain outraged, as is the current fashion on so much of the internet today.

            I can't remember the details from back then, but I think there were a few quirky command constructs pre version 3, and there was an effort to make some of the language features more consistent with other parts of the language. I remember reading about people who found the task of transitioning existing code to the new version was not really a great ordeal. I can't be sure tho, I haven't used or followed Python discussion for some time.

          3. JohnFen

            Re: 20 years is a lot of time.

            > try taking C code from 1975 and compiling it and running it today.

            OK, I did this last night with a few programs. There was no problem, as expected.

      2. DavCrav

        Re: 20 years is a lot of time.

        "Are people still using Windows 98 SE? No? Then why are they still using Python 2?"

        Are people still using C? Yes. First released: 1972.

        Are people still using COBOL? Unbelievably yes. First released:1959. C++ is from 1984.

        1. Teiwaz

          Re: 20 years is a lot of time.

          Are people still using COBOL? Unbelievably yes. First released:1959. C++ is from 1984.

          I never get this - for most business logic, COBOL is still perfect. I've been hearing 'academics' knock COBOL for decades - starting at Uni in the early 90's 'nobody uses COBOL anymore' all the staff at one notable English University stated categorically.

          Granted, COBOL could do with modernisation, but mostly it's an image makeover it needs.

          1. chris_stjohn

            Re: 20 years is a lot of time.

            Remind me - how many digits should we reserve for the year number?

        2. joeldillon

          Re: 20 years is a lot of time.

          There are still industrial automation systems etc running things like Windows NT 4, yes.

          1. EnviableOne

            Re: 20 years is a lot of time.

            i have it on good authority one bank HQ is still running an ICL Mainframe, with most of the parts sourced from a friendly internet based auction site ....

      3. Pascal Monett Silver badge

        Re: see if it still works

        If you have a complete system, then maybe. You might want to replace the CMOS battery before starting it up.

        However, I regret to say that Win98 SE no longer installs on existing hardware since about a decade ago, if not more. Even XP can no longer install on "modern" hardware.

        That's why I moved to Win 7.

        1. LenG

          Re: see if it still works

          The Win98 machine may work but you may find that the bits have fallen off the floppies.

          As for Win 7, you do know that neither Intel not AMD support it on their more recent CPUs? From what I have read, installing in on a new AMD Ryzen system is a real pain due to the USB support.

      4. Anonymous Coward
        Anonymous Coward

        Re: 20 years is a lot of time.

        Twenty years is nothing if your main business is in getting things done, and computures - and languages you write in - are but a tool, merely means to an end. It is pretty common for the computer programmes to outlive both the hardware they were originally written on, and their original creators. Much of of scientific computing - the area where I have some idea what I am speaking about - is like that. From what I read and hear, much of the industrial control machinery, air traffic control, and business back-end processing - things which, unlike the eye candy of the web, matter in real life - is the same. You write these things rather infrequently, at a great expense - and afterwards you expect them to work, given good maintenance, essentially indefinitely - like any good machine. The very last thing you want in these situations is a computer language which keeps introducing incompatible changes underneath your process- and possibly life-critical code.

        Naturally, there are also quick'n'dirty prototyping and analysis gadgets. Those you'd rig up quickly, using whatever bits of code and duct tape you have lying around. In those cases, you don't really care if the language you use will drift in five years' time, making your scripts unusable. Even then, these things tend to come back and bite you when you realise some time later that you could have used these tools for something else again - except they no longer work, even though your code haven't changed a yota.

        I know what kind of language I prefer - but to each his own.

      5. dajames

        Re: 20 years is a lot of time.

        Are people still using Windows 98 SE? No? Then why are they still using Python 2?

        Because Python 2 is still being supported by its originators, which Windows 98 SE isn't.

        Because they have big systems written using frameworks written in Python 2 and either the framework hasn't been migrated to Python 3 or the upgraded version isn't quite compatible with the old one and they can't see any reason to migrate.

        Dropping support for Python 2 should have been done years ago! Not in 2015, maybe, but extending to, say, 2017 would have made more sense than 2020.

      6. katrinab Silver badge

        Re: 20 years is a lot of time.

        People aren't using MS DOS v3 any more, but they are still using Objective C, both released in 1984. A new version of an operating system does not mean a new language.

        1. DCFusor

          Re: 20 years is a lot of time.

          I still run a version of Protel PCB layout tools in DosBox for the odd board I need to design. Does that count? The old version was free, ran on 286's. It screams on a modern machine in dosbox as you might guess. It just makes PCB artwork that's still accpeted by every major fab house and usable for contact printing in house.

          The new version of protel tools costs several tens of thousands of dollars and has added so many features you need to hire a dedicated guy to study and use it all day to stay up with it, buy component libraries with pinouts and definitions for schematic capture instead of just saying "give me a qfp 32 here". and for small scale use is the very definition of impractical.

          Perhaps things like this are why some people keep using the old stuff? IT works, it's simple, the learning curve is less, and they get on with doing their business instead of giving all hope of profit to some over complex tool creator.

      7. bombastic bob Silver badge
        Facepalm

        Re: 20 years is a lot of time.

        "Then why are they still using Python 2?"

        because they WANT to! Nun-Ya-Business!

        In some businesss you may find Win '9x still in use, particularly for controlling machinery that's >20 years old and there are *NO* device drivers written for that old machinery for Win-10-nic, if for no other reason that Micro-shaft's "driver signing" policies

        And why is it YOUR business whether or not people CHOOSE TO USE SOMETHING THAT WORKS WITH OLD CODE THAT STILL DOES THE JOB ???

        "UP"grading is _SO_ overrated... if not for the feature creep and API breakage, I'd do it more often.

        (quite obviously I don't - I like stable systems that don't waste my time constantly maintaining them, and instead are fixed targets that don't keep moving like Lucy and Charlie Brown with the football.)

        icon because, facepalm you'd actually say that

      8. EnviableOne

        Re: 20 years is a lot of time.

        I still think 98SE sp5 was the peak of Windows.

        Its still more satble than this mess of win 10.

  6. fobobob

    But but

    print "but my parentheses-free print statements!"

    1. Jason Bloomberg Silver badge
      FAIL

      Re: But but

      If they had found some way to fudge round that issue I believe most reticence in migrating to Python 3 would have disappeared. But it seems the desire for 'Python Purity' outweighed pragmatism.

      What worries me more than other cases, where a language or framework becomes "not supported" but everything works the same the day after as it did the day before, is the current plan appears to be tending towards pulling the rug out from under 2.7 user's feet. It's really not clear to me what will happen when 2.7 reaches 'end of life'.

      1. david 12 Silver badge

        Re: But but

        It was c purity they were trying to maintain, as also shown by the <> != change, and the insistence at the time that the c library was the only possible way to do math (thankfully abandoned soon after, but following years of amazing blindness)

        The people who maintained python-written-in-c were really c programmers at heart, and at the time of the fork between 2.x and 3.0, their idea of what a language should look like was still defined by c.

  7. amanfromMars 1 Silver badge

    For All Those Right Comfortable in the Driving Seat with AIMagical Monitoring Mentors.*

    Changeset, a consulting company that offers "short term project management services for free and open source software projects", to "help communicate about the sunsetting of Python 2".

    Nice one, Changeset. Bravo. Very Agile in Deed indeed.

    That puts you in a remote position expectant of delivering leading novel information for activation/presentation/revelation thus to demonstrate viable physical lead in and from surreal virtual stimulations and simulations.

    *Injun Territory, Kemo Sabe. :-) ..... although with King Solomon's Mines Booty and Bounty, what's not to like? :-)

    The Future AI and IT now simply require that you make a Quantum Communications Leap with Orders to Prevail Fully Availed of AIMaster Resources.

    Any other choice leads eventually, inevitably, to the dank and deadly depths of darkness .... so the QCLeap is a No-Brainer.

    1. Tail Up

      Re: For All Those Right Comfortable in the Driving Seat with AIMagical Monitoring Mentors.*

      Do the ten downvoters seem to be ready to loose?

  8. Anonymous Coward
    Anonymous Coward

    Python -- Major version changes....

    Python 1.5 was where I started...great language to get going with. The move to Python2 was essentially painless....also great. Then I had to move everything from Python2 to Python3.....even for my modest portfolio of code this was an absolute nightmare. Three related components of this nightmare stand out. First there was Unicode. Second was the bytes vs strings innovation. Then there was the "helpful" utility 2to3 which often didn't help. The second one was marginally more painful than the first because my Python2 code had lots of places where the code was reading and/or writing to low-level database files (FoxPro and the like).

    Anyway, it does not surprise me in the least if organisations with mountains of Python2 code are REALLY LEERY of converting their code. Good luck out there!!!

    1. Psmo

      Re: Python -- Major version changes....

      bytes vs strings innovation

      my Python2 code had lots of places where the code was reading and/or writing to low-level database files

      Ouch. However, in my experience the Python 3 way of doing IO leads to far fewer encoding gotchas.

      YMMV of course, but paste the following into a Windows-based Python 2.7 interpreter, then a 3.7 interpreter to see what I mean:

      import ctypes; ctypes.windll.user32.MessageBoxW(0,"ça ne marche pas","la même",0)

      1. AdamWill

        Re: Python -- Major version changes....

        Yeah. Converting things can be a pain, but it's kinda forgivable really because the Python 3 ways are all clearly *better*. The things they change were...bad. 3's way of dealing with strings is just clearly an improvement on 2's and avoids all kinds of pitfalls that 2's approach had. I don't really see that you could've fixed the messiness of strings and unicode in Python 2 while remaining backwards compatible, and not fixing them wouldn't be a great choice either.

        1. Charlie Clark Silver badge

          Re: Python -- Major version changes....

          I agree that most things in Python 3 are more consistent and it's now generally faster than Python 2. But I still want my print statement back! :-)

        2. Paul Crawford Silver badge

          Re: Python -- Major version changes....

          For me it is the change in divide behaviour that is unforgivable. Python 2 follows the same convention as C, Fortran, etc, that int/int = int where as for Python 3 they decided you wanted that promoted to a float.

          Still, maybe I was the fool for assuming anything stable in a weakly typed language...

          1. unimaginative
            FAIL

            Re: Python -- Major version changes....

            Python is a strongly typed language.

            It is also a dynamically typed language.

            1. amanfromMars 1 Silver badge

              Re: Python -- Major version changes.... for AAA Virtual Instruction

              Python is a strongly typed language.

              It is also a dynamically typed language. ..... unimaginative

              :-) unimaginative by name, maybe, .... but never by nature of speech direction/subliminal edutainment.

              Welcome to the AIMad Housing Projects, unimaginative, where Advanced Anonymous Autonomy is a Default Divine Construction/Fave Rave Modus Operandi/Vivendi.

    2. Charlie Clark Silver badge

      Re: Python -- Major version changes....

      Then I had to move everything from Python2 to Python3.....even for my modest portfolio of code this was an absolute nightmare.

      Can't agree with that. If your code runs in 2.7 then changes to syntax should be minimal, and avoid 2to3. You'll obviously have some work to do with extensions, but again nothing insurmountable. But, of course, all such changes are work.

      Python 2 was actually just a rebranded version of Python 1.6, which is why moving to it was painless.

  9. Julian Bradfield

    So Python will finally be a stable and reliable piece of software!

    1. Hogbert

      No, you are thinking of Python 4, which will use braces to define code blocks instead of indentation.

      <ducks>

  10. Crazy Operations Guy

    What happened in version 3?

    It seems really weird to me that an interpreter for a programming language can't handle code written for older versions of the code. Like I have some old K&R C that still compiles just fine with a C18 compiler. I have ancient Java that works with a recent JRE, I have 10+ year old JS that works in modern browsers. Sure, I get warnings about deprecated functions and constructs, but the compiler / engine is intelligent to work around that by simply branching to the old compiler's code So what happened to Python 3 that is making migrating from the 2.x series so difficult?

    I have very, very little experience with Python, but a wealth of experience with plenty of other languages ranging from ADA to Java, and even PowerHell. And they all have some method of running the old code, and when introducing incompatible updates to previous code, they'll almost always just implemented new functions instead.

    1. Charlie Clark Silver badge

      Re: What happened in version 3?

      In practice, the syntax changes between Python 2.7 and Python >= 3.3 are minimal. The main change that caused problems, apart from print "hello world" becoming print("hello world"), was the stricter separation of unicode and encoded strings, which unicode becoming the default. Turns out that Python is used for lots of network and file system work so that this caused a lot more problems than anticipated. Once the unicode literal was reintroduced in Python 3, it became easy to write code that runs well in both and is straightforward to maintain.

      The change was necessary because Python initially didn't have unicode support and added later. This wouldn't matter that much in an ASCII world, but Python has long been very international. There were other changes under the hood but this was the main sticking point for most. To this must be added that Python 3 required more memory and was slower than Python 2, which had benefitted from a performance release with 2.5. So 10 years ago developers were being asked to do some work to migrare their codebase to a slower platform. Yeah, not the best of arguments.

      However, having maintained the codebase of a popular library since 2013, I can confirm that writing code that runs in both Python 2 and Python 3 isn't that hard.

  11. Rich 2 Silver badge

    OMFG

    What a dire state the software industry is in when the top three most popular languages are JavaScript (wtf????) java and python.

    1. Martlark

      Re: OMFG

      It's because these are useful powerful languages at the heart of an immense packaging ecosystem. The organisation of libraries has become more important than individual language features

      1. DCFusor

        Re: OMFG

        Sadly this is true. The learning curve of any new language can't be that bad anymore - it has to be able to do the Turing stuff, usually does some math, some typing, some scoping - it's just a question of how to pronounce that in this one.

        The library/module ecosystem now, that's amazingly complex, different, variably maintained; which of the 10 things in this repository that claim to parse some markup is the best for my task, and imposes what other design constraints - callbacks vs blocking, how does it handle poorly formed input?.

        That's where the real pain resides. Evidently someone wrote wrappers around some C/C++ junk for ML (no one writes math intensive stuff in an interpreted language if they're older than 10) - and they are popular. If they'd been written in some older language, or some other "Fad of the year" one, the same would be true in ML - that would be the hot thing. It has little to do with python itself.

    2. Anonymous Coward
      Anonymous Coward

      Re: OMFG

      Hoping one day Web Assembly kills off Javascript.

    3. Anonymous Coward
      Anonymous Coward

      Re: OMFG

      You probably haven't written anything in ECMAScript, yet, I gather?

      Syntax, language features and implementation performance have improved considerably since the early status bar marquee on Geocities. I strongly prefer HTML+JS for user interfaces over having to deal with Tcl/Tk or the behemoth that is QT.

      1. Rich 2 Silver badge

        Re: OMFG

        And what do you use when you don't need a user interface?

    4. Crazy Operations Guy

      Re: OMFG

      Just because a programming language is popular, doesn't mean there is much written in it. A lot of studies of 'most popular' are done by just looking at common code repositories (Usually github or Sourceforge) and checking the extensions of the files (Some are even lazier than that and just look at project tags). Such studies rarely consider such factors as lines-of-code, activity, etc.

      You may end up with situations where a repository has two JavaScript projects that might have a dozen lines each and only have been touched twice in the last decade, and only a handful of people in the world actually use it. But the you have a single project written in C that encompasses tens of millions of lines of code and is seeing contributions several times an hour, and its used by literally billions of systems around the clock. In that case, these studies would still show that JavaScript is the most popular language.

      For every Linux Kernel, you have hundreds of trivial projects written in simple languages, many by CompSci students as a term project.

      The problem remain as long as we human stay obsessed with tacking numbers onto things that can't be easily quantified. Like, do you count the popularity of a programming language by number total software projects that use it? Lines of code? Number of contributions? Download count? Installation count? Execution count? Number of cycles the code has used globally? Or do you go with something based on humans and ask everyone what their favorite language is? Which one they use most often? Or even some subjective factor like what language is most important to humanity?

  12. Fazal Majid

    The problem is not libraries dropping Python 2 support

    But dormant libraries that are still in use that will never be upgraded to Python 3.

    At some point, companies will have to bite the bullet. In my case, my migration plan is to switch to Go.

  13. karlkarl Silver badge

    The majority of Python developers are either hipsters, juniors or rushers. These are not the sort of people who care about maintenance.

    That said, the idea of ever using a language that becomes obsolete like this is stupid. The statement "Ada has outlived Python, Python 2 and one day Python 3" is not only quite funny but also now quite correct.

    1. Teiwaz

      Ada?

      "Ada has outlived Python, Python 2 and one day Python 3" is not only quite funny but also now quite correct.

      I've not heard anyone mention Ada since the early nineties, along with Modula-2 and Pascal.

      1. Kevin Fairhurst

        Re: Ada?

        We used Ada on my CompSci course at York, '94 to '97. And then when I learned PL/SQL in 2001 I realised that it was pretty much ripped off from Ada :)

      2. Anonymous Coward
        Anonymous Coward

        Re: Ada?

        I only heard of Ada when Ada code famously floored the first Ariane 5 rocket. Provably correct code is not always used in the right location.

        Be glad you don't have to program in MUMPS because that makes Perl look well-structured in comparison.

  14. John Geek

    heck, I remember seeing how painful it was updating large complex code bodies from 2.3 to 2.5, never mind 2.x->3 I'm really really thankful I never jumped on the python bandwagon

  15. Herby

    Why didn't they...

    Make a simple transition tool. Takes in "python 2(.7)" and emits "python 3". The parser for python2.x already exists, just change what it outputs. Sure it might not be "optimal", but it ought to work. If it doesn't (something that doesn't translate) emit a nice message and a couple of suggestions, and let it go.

    Sounds like the way to go for me.

    Of course, I prefer nice ANSI C89, which doesn't have such fluff as '//' comments and the like (and MISRA seems to agree!). Of course YMMV!

    1. Charlie Clark Silver badge

      Re: Why didn't they...

      They did. It's called 2to3 but turned out not to be a good idea, because the resulting code would only run on Python 3. In practice it's relatively straightforward to write code that runs on both Python 2 and Python 3

      1. Tom 38

        Re: Why didn't they...

        futurize, from python-futures is a better bet. I maintain many 2/3 compatible libraries, even some with C extensions, the trick is to make python 3 code that also works in 2.

        Python 3 is clearly better to work in than 2. Once you have good Python 3 code, getting that to work in Python 2 is quite straightforward, simply because of the design choices of 3. You have to know where in your program you are dealing with strings, and where in your code you are writing or reading bytes. Those bits with bytes always happen at disk or IO points.

        Lots of Python 2 code is poor at these points - ever see mojibake or UnicodeDecodeError/UnicodeEncodeError? - and Python 3 is just not. Even if you don't switch to 3 just yet, making the code Python 2/3 compatible invariably means making it better to run on 2.

        1. Allonymous Coward
          Devil

          Re: Why didn't they...

          UnicodeDecodeError

          I just had horrible flashbacks to working with CMSes based on Zope. Thanks for that.

        2. amanfromMars 1 Silver badge

          Re: Why didn't they...

          You have to know where in your program you are dealing with strings, and where in your code you are writing or reading bytes. ... Tom 38

          The Register here is always dealing strings for any and all of your programs.

          The Sure Fire Aim of the Greater IntelAIgent Game is to Captivate and Release an Almighty Narrative in Currents of New Fangled Entangling Information Surrounding and Shrouding Novel AI Systems in Command and Control Outposts Never Quite Fully Prepared for Presentation. :-)

          Always be prepared for the rogue spanner in the works. Where's the excitement without a glitch or two for sorting/exercising.

  16. Povl H. Pedersen

    Java popular ?

    How can you call Java popular ? Have you talked to a Java programmer recently ?

    You might say it is one of the 3 most widespread languages (like diseases can be spread). But popular is a complete misconception.

    For all that does not know, 9 out of 10 cases, AI stands for A-lot-of-Indians. They are cheaper to train, uses way less power, and generates results of the same quality as household AI available for decent money. It is real intelligence to substitute Indians for CPU.

    1. sum_of_squares

      Re: Java popular ?

      Oh well. There are probably two types of programmers: Those who made a lot of money with Java and suffer from stockholm syndrome. And those who hate Java with a passion..

      All jokes aside, there aren't too many large scale industry languages out there. We will see wether Oracle's pricing policy was a good idea or not. And of course today we can use languages like Kotlin or Scala (or Clojure if you are a real 1337 haxx0r) which are much more pleasant and rewarding than Java. But there's still a metric crapton of Java legacy code out there so Java won't simply disappear over night.

      Talking about legacy code.. No matter who hard Guido forces the Python 3 Meme, we will stand with Python 2 till the very end !!1!

      (;__;)7

      [/irony]

  17. Rudolph Hucker the Third
    Boffin

    I didn't get where I am today without being part of the "Statler and Waldorf" wing of El Reg. But my medication is working well today, so I will play-nice and share my top two tips for migrating production Python sites from 2.x to 3.x

    1) Replace all PRINT with a wrapper function (say) PrintThis()

    PrintThis() can then include a check on the config Development/Production status and switch accordingly.

    Print to console is fine in Dev. But in Production, PrintThis() should switch output to Log files or a Log database (your choice)

    2) For every INCLUDEd library in your 2.x code

    On Linux:

    sudo python3 pip -m install ThisLibrary

    On Windows (e.g. in Visual Studio):

    Switch the Python Environment to 3.x.

    Use pip and search PyPI for each library, and install.

    1. Tom 38

      import logging

      log = logging.getLogger(__name__)

      log.info("This is better")

      Although reg's formatting is not.

      1. Charlie Clark Silver badge

        You need to cut out the extra newlines.

        1. Tom 38

          There were no extra newlines, that was just 3 lines in a < pre > block :/

  18. DrXym

    No wonder

    Python took too damned long moving off 2.x to 3.x and unsurprisingly a lot of entrenchment occurred which made moving even harder. From the moment Python 3 was a thing they should have EOL'd version 2 - bug and security fixes for a few years and then it's over.

    All the focus would have shifted to 3.x rather than straddling two versions and all the burden of backporting stuff and keeping two codebases in sync. If someone were desperate for 2.x continuance they could have forked it but the majority of devs would have simply moved over to the latest and greatest.

  19. codejunky Silver badge

    Hmm

    Yes its painful to upgrade when the language changes. 2.7 to 3 is a fair change but who moved from php4 to 5? It happens. At least the language didnt die off like VB6 to .net.

    I have some personal projects in python 2.7, one because it runs faster in v2 than 3 but if I need to update it I will. Most of the code will work already with little modification and v3 has fixed a few irritating problems.

  20. Anonymous Coward
    Anonymous Coward

    Well suited?

    "AI and machine learning, for which Python is well suited."

    Wel perhapsl not really any more so than any other procedural or OO language. It just happens to be have been the prefered language of the sort of CS types working in AI in the last decade or so. And if you look at Tensorflow all the heavy lifting and GPU data flinging is actually done in libraries written in C++. You didn't have that with Lisp or Prolog - all the code down the stack was written in those languages (if you didn't count the compiler itself).

  21. simonb_london

    Better headline

    How about:

    "from future import obsolescence"

    ?

  22. Do Not Fold Spindle Mutilate

    Chromebooks have an expiry date

    Gosh, Gevil corporation makes there chromebook os expire in six years. After that no security fixes so the owner becomes a magnet for ransomware.

    The real reason the expiry is a problem is that most companies expect that software should be completely free. Companies are not willing to pay now and not willing to pay later. To get a budget for an upgrade (not python) I told the CFO that auditors would not approve the financial statements because the software was out of date and could not be relied upon. Only when the CFO realized his job was "on the line" did he authorize a minimal amount of money to do minimal upgrades.

  23. Anonymous Coward
    Anonymous Coward

    Python1

    What happened to python(1) ? Was there a similar issue moving from that to python2?

    1. Psmo
      Boffin

      Re: Python1

      Python 1.5 -> 2.0 was essentially an license ownership change; the ownership of Python by Guido Van Rossum's employers of the time was changed for a more open license that evolved to the open and nearly-everything-compatible current Python license of 2002 onwards.

  24. Henry Wertz 1 Gold badge

    updating python 2.7 code

    Updating python 2.7 code to python 3 is not difficult. A couple functions were renamed (and you can load a compatibility header to take care of them rather than updating them), and a few syntactical details changed. So you don't have to really rewrite code so much as replace a handful of lines with ones with identical functionality but slightly different syntax.

  25. alauddinmondal

    Python

    Python is robust language. Before I used PHP. But one thing is here python used apps based module where other languages don't have this facility. It makes very easy to understand the whole project. Thank you!

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like