Live data from Hacker News

Extend Python 2.7 life till 2020

hg.python.org

41–50 of 286 posts

Re: Extend Python 2.7 life till 2020

#41

This is a result of some not so optimal design decisions in the past. I remember, when Py3 first came out, everything was incompatible -- unnecessary incompatibilities like the u" notation for Unicode string literals that was dropped. Unnecessary incompatibilities in the C-extension-module implementation layer. And so on. The list of incompatibilities was just huge. Later several of them where dropped, like the strin…

> unnecessary incompatibilities like the u" notation for Unicode string literals that was dropped

I mean a hard difference between a string and bytes and strings being utf-8 by default seem to be a necessary (and good) reason?

Re: Extend Python 2.7 life till 2020

#42
post #34

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…

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…

That's not a valid reason to avoid making the switch. A big backlog of code that you can't afford to port is valid; it's a business issue. But you? This is a tool of your trade, just do the research.

Re: Extend Python 2.7 life till 2020

#43
post #28

Earlier quoted context omitted.

PHP5 was almost completely backwards compatible with PHP4, Python 3 has much larger changes.

Just the entire OOP system changed. However, nobody noticed because nobody used the OO features in PHP4.

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 various projects agreed to a common date of "end of support" for PHP 4, sending a message to hosting companies to either upgrade, or not be able to deploy wordpress and co anymore

Re: Extend Python 2.7 life till 2020

#44
post #28

Earlier quoted context omitted.

PHP5 was almost completely backwards compatible with PHP4, Python 3 has much larger changes.

Just the entire OOP system changed. However, nobody noticed because nobody used the OO features in PHP4.

The point from jiggy2011 is rather that the differences from PHP 4 to PHP 5 didn't break much of the existing PHP4 code.

In PHP 4 for example you had an object model where the constructor was a method named alike to your class. In PHP 5 you got the __construct() magic method, but as a fallback, the method named to your class still works as constructor.

The same holds for properties defined with var instead of public/protected/private. For compatibility again, the var keyword is just interpreted as a public property.

As a third example, PHP5 came with an OOP system with support for interfaces, abstract classes and the final keyword. In PHP4, this wasn't available. So, there is no PHP4 code which uses these concepts, making them work in PHP5 as well. Obviously, this doesn't work the same way around.

There are some backwards compatibility issues, but these are minor in contrast to what you probably had written in PHP4 back then [1]

Now, for Py2 vs Py3 this is a completely different story. Py2 code doesn't run automatically on Py3. See this answer [2], as there were so many porting issues developers didn't had the time to overcome the overhead just to port the code. So: no, you can't compare the PHP 4 > 5 change to the Py 2 > 3 change.

[1] http://www.php.net/manual/en/migration5.incompatible.php [2] https://news.ycombinator.com/item?id=7581584

Re: Extend Python 2.7 life till 2020

#45
I just got back into some Python programming after a 2+ year hiatus from the language.

I'm stunned that this 2.x vs 3.x debate is still happening and that 99% of all libraries in use* haven't been converted to 3.x. I like the language, but ... damn... If it weren't for the scikit/numpy stuff, I'd stick with Ruby. The Ruby community seems much less fragmented and wants to see the language move forward. It helps a lot that the 800 pound gorilla, Rails, keeps up with Ruby releases.

edit: * By that, I mean that the conversion rate for commonly used libraries hasn't hit 99%.

Re: Extend Python 2.7 life till 2020

#46
post #45

I just got back into some Python programming after a 2+ year hiatus from the language. I'm stunned that this 2.x vs 3.x debate is still happening and that 99% of all libraries in use * haven't been converted to 3.x. I like the language, but ... damn... If it weren't for the scikit/numpy stuff, I'd stick with Ruby. The Ruby community seems much less fragmented and wants to see the language move forward. It helps a lot…

This is completely not true, on PyPi there are more libraries supporting 3.x than 2.x. The only major 2.x packages that I can think of that haven't been ported are twisted and gevent(?).

http://python3wos.appspot.com/

Re: Extend Python 2.7 life till 2020

#47
post #45

I just got back into some Python programming after a 2+ year hiatus from the language. I'm stunned that this 2.x vs 3.x debate is still happening and that 99% of all libraries in use * haven't been converted to 3.x. I like the language, but ... damn... If it weren't for the scikit/numpy stuff, I'd stick with Ruby. The Ruby community seems much less fragmented and wants to see the language move forward. It helps a lot…

Where do you get that many libraries that aren't converted? Most, at least the ones still under development, are.

Re: Extend Python 2.7 life till 2020

#48

I see many comments talking about how this will slow down the migration process. But I don't think the situation is that bad. Most of the py3 wall of superpowers is now green ( https://python3wos.appspot.com/ ) with boto, mysql-python, nltk, python-openid being some of the rare few in terms of not having great py3 alternatives. And most of these have ports on the way already. So one interesting effect of this is that…

Just a quick note: NLTK supports Python 3 for more than year in the main github branch; there were several alpha releases that support Python 3, but no "stable" pypi release or a beta. There is no stable release because of unfinished tasks unrelated to Python 3 support.

Re: Extend Python 2.7 life till 2020

#50
post #42
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…

That's not a valid reason to avoid making the switch. A big backlog of code that you can't afford to port is valid; it's a business issue. But you? This is a tool of your trade, just do the research.

"Tool of your trade": I have no use of python 3, nor do I have any use for Scala, Perl, or whatever. These could all be considered "tools of my trade".

I rarely write anything high language besides small scripts. Python 2 does the job. If I ever were to need functionality of another language, great, it's fun to learn something new. Our time is limited and we must prioritize. Sadly we cannot invest time to learn everything (well I guess it's possible, but I rather be awesome in four languages than mediocre in twenty).

Post reply on HN