Live data from Hacker News

Extend Python 2.7 life till 2020

hg.python.org

131–140 of 286 posts

Re: Extend Python 2.7 life till 2020

#131
post #74

How I'm not surprised. Python 3 didn't offer anything that would have been so useful and desirable that people would've jumped on it the moment it was released. In fact, it was actually a bit worse than Python 2 when it was out and those Python 2 users could continue enjoying loads of libraries to go with, and of course they knew how to navigate around Python 2's quirks so why bother. Sadly, this is still what I thin…

>it was actually a bit worse than Python 2 when it was out

It still has a few things that really suck!

The thing that bothers me the most is the removal of in-argument tuple unpacking. For example, in python 2.x you could write:

dist = lambda (x1,y1),(x2,y2) : math.sqrt((x1-x2)2 + (y1-y2)2)

Whereas in python 3.x you must write

dist = lambda p1,p2 : math.sqrt((p1[0]-p2[0])2 + (p1[1]-p2[1])2)

Which is just awful to read. It gets much worse when you're trying to program in a functional style and you are using triples or quadruples. Imagine using "x[1], x[2], x[3], x[4]" instead of something like "length, width, height, color".

PEP 3113 attempts to rationalize this change, but it's kind of an awful PEP. It claims "no loss of abilities removed", which is clearly false, and the proposed benefits are highly specious. The entire tuple-unpacking system could just be reduced to the insertion of an unpack instruction at the start of the function. That would actually make a lot of sense with Python's policy of "ask forgiveness rather than permission", since trying this with the wrong tuple length would throw a ValueError explaining what went wrong.

I also miss (but it's not really an important language feature like in-argument tuple unpacking) the ability to do encoding directly on strings. For example,

"hello".encode('hex')

or

"aGVsbG8=".decode('base64')

That was much more convenient than having to import some library and use library methods.

Re: Extend Python 2.7 life till 2020

#132

This is really disappointing to see - I fear that it will slow adoption of Python 3 even further, when it was just reaching a tipping point[0]. When I first learned Python, I learned Python 3 first because it was newer, and I figured everyone would be using it soon enough. Little did I know that Python 2 would continue to be supported for over ten years after that! Some people make a big deal about figuring out "whic…

I chose to learn Ruby in part because of the confusing Python 2/3 issue. I recognize that this is a largely stupid reason to choose a language, but when lots of people suggest that either language is great to pick-up, well, it was another easy reason to lean Ruby over Python.

I don't agree at all that it's stupid (and I'm someone who'd generally pick Python over Ruby). Fragmentation sucks. Really bad fragmentation sucks more. Python's fragmentation is pretty bad.

Re: Extend Python 2.7 life till 2020

#133
post #92

Earlier quoted context omitted.

> I have no use of python 3 You admit you haven't done any research, so you clearly don't have any basis for making that statement.

Nor have I done research on Perl, Scala, etc. Your missing my point. I am successfully getting my things done in Python 2. I do not have any use for Python 3, Perl, Scala, or any other language. I might have in the future, and hey, some language might be better suited to solve the problem - but as long as it's not drastically better the sensible tradeoff is to stick with Python 2.

So much for having a big toolbox with lots of different hammers available to you.

Re: Extend Python 2.7 life till 2020

#134
post #127

Earlier quoted context omitted.

> Well honestly, python 2* is a lot more convenient to write in a lot of ways In what way is python 2 more convenient to write? Outside of the rapidly shrinking set of cases where the best approach to a key problem is addressed by a Py 2 only library -- or the case of "I want to deploy on Google App Engine" -- I don't really see how Py 2 is "more convenient".

[deleted]

Both ways of formatting are available. % is not going away.

Re: Extend Python 2.7 life till 2020

#135
post #56
post #34

Earlier quoted context omitted.

On the other hand, if you are comfortable with Python 2, it will do the job, and you know it will be supported for a foreseeable future, why bother learning Python 3? I assume there is a good answer for switching to Python 3, but I honestly don't know (haven't bothered to do any research though). Harshly put: I care about getting my python script working as soon as possible and for a foreseeable future - I couldn't c…

Well, the one big reason was that you were going to lose support for Python 2. Guido just took that reason away and now tens of thousands of new Python apps are going to be written in Python 2 because they've got another 6 years to worry about it. Guido just created a bigger problem. No good deed goes unpunished.

It feels like the problem is the black-and-white thinking on the part of developers of every language being either "okay to develop in" or "completely unsupported."

If only there was a way to deprecate a language, with the same meaning as deprecating an API method: "it's not gone yet, but it will be soon, so in strict mode using it is an error." (The main problem to solve would be: strict mode of what? The package manager?)

Re: Extend Python 2.7 life till 2020

#136
post #52
post #43

Earlier quoted context omitted.

To this day, old PHP 4 objects code still works in the lastest PHP version The difficulty of upgrade for PHP didn't come from the devs having to redo / revalidate parts of their code for little to no immediate benefit (like in Python's case) but in the shared hosting companies (un)willingness to make the upgrade when the scripts their users wanted (phpbb, wordpress, ...) worked fine with PHP 4. And that's why these v…

I know of a small company (won't publicly shame them) that to this day is actively developing a php 4 code base. The reason is that they use a couple of libraries which do not work in php 5 and don't have the time/manpower to port it.

Do you know what libraries can't be ported without a lot of effort? I haven't heard that in a long time.

Re: Extend Python 2.7 life till 2020

#137
post #116

Earlier quoted context omitted.

Try Python 3.4 I agree with the sentiment, and 3.2 had some rough edges still, 3.3 is better and 3.4 finally gives a virtualenv similar (or even better) to Python 2

Still sucks when youve got modules with c extensions, lile any usable fast module, the virtualenv doesnt virtualize that.

uwsgi (as an example) has C components and builds/installs on a virtualenv

Re: Extend Python 2.7 life till 2020

#138

This is really disappointing to see - I fear that it will slow adoption of Python 3 even further, when it was just reaching a tipping point[0]. When I first learned Python, I learned Python 3 first because it was newer, and I figured everyone would be using it soon enough. Little did I know that Python 2 would continue to be supported for over ten years after that! Some people make a big deal about figuring out "whic…

I chose to learn Ruby in part because of the confusing Python 2/3 issue. I recognize that this is a largely stupid reason to choose a language, but when lots of people suggest that either language is great to pick-up, well, it was another easy reason to lean Ruby over Python.

Hear, hear.

Re: Extend Python 2.7 life till 2020

#139
post #133
post #92

Earlier quoted context omitted.

Nor have I done research on Perl, Scala, etc. Your missing my point. I am successfully getting my things done in Python 2. I do not have any use for Python 3, Perl, Scala, or any other language. I might have in the future, and hey, some language might be better suited to solve the problem - but as long as it's not drastically better the sensible tradeoff is to stick with Python 2.

So much for having a big toolbox with lots of different hammers available to you.

I do have a big toolbox, it contains all kinds of screwdrivers etc for low level programming. But I only need one hammer for the few problems I face that is best solved by scripting languages.

Re: Extend Python 2.7 life till 2020

#140
There are a lot of comments here from people who aren't on the python-dev list and don't really understand what this diff actually means.

The core developers are not required to maintain 2.7 post-2015, and most of them won't be involved in it. That part hasn't changed.

What is happening is that Red Hat is preparing to cut a RHEL 7 release, which AFAIK depending on how much you pay them they support for 13 years. So they will need to figure out how to support 2.7 themselves at least through 2027.

Here is where I am reading between the lines. RH are well within their right to fork Python and keep their maintenance patches to themselves and their customers (Python's not copyleft). But, they are nice guys and so maybe they are willing to upstream their changes at least for awhile if there is still a Python project willing to accept them. Again, this is my speculation based on the ML discussion, not what RH has actually said they will do.

An analogy can be made to Rails LTS, a commercial fork of Rails 2.x that patio11 was involved in [0]. Inevitably somebody is going to step in to support 2.7, and so let's see what we can do to avoid a situation where the only way to keep running 2.7 is to subscribe to RHEL.

Meanwhile, there are some large companies that use 2.7 extensively on Windows (e.g. Enthought, Anaconda) and the thinking goes that somebody can probably be found to produce a Windows installer once in awhile, assuming that Python.org will still host a download.

So really what is happening here is not very exciting. The core committers aren't doing anything different than leaving the project as originally planned. What is happening is that they will leave the lights on in the source control repository and on the FTP server, so as to capture the free labor from people at large companies who have an interest in continuing to support 2.7.

The alternative is that RH and other vendors create proprietary and expensive forks of Python 2.7. That may end up happening anyway, but it will take longer for your employer to notice you should stop contributing your patches back if binaries still appear on python.org and you don't have to ask IT to set up SCM and a bug tracker, etc.

[0] http://www.kalzumeus.com/2013/06/17/if-your-business-uses-ra...

Post reply on HN