Live data from Hacker News

Extend Python 2.7 life till 2020

hg.python.org

171–180 of 286 posts

Re: Extend Python 2.7 life till 2020

#171
post #148
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…

> 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? This bothers/worries me, because I don't understand where this notion that "learning Python 3" requires significant effort or commitment comes from. Python 3 isn't massively different from Python 2. I learn more "new stuff" (APIs I've never used befor…

It's not about the language. Languages are easy to learn. I can learn one between breakfast and lunch and be productive by dinnertime.

I use Python 2 because of the massive ecosystem of libraries that have been written, work, and will continue to work.

It's shortsighted and more than a little irresponsible to shame or muscle people into switching. Code that works is valuable. Code that has been tested for a decade is valuable. What's not valuable is forcing an upgrade to a platform that nobody wants to upgrade to while forcing us to abandon third-party code with years of field testing that the authors aren't ever going to port to python 3.

Re: Extend Python 2.7 life till 2020

#172

Earlier quoted context omitted.

Yes but PHP5 had compelling reasons for upgrading. py3 has a few tweaks and some annoying syntax changes to make things more "pure"

So, counter-intuitively, the bigger leaps are easier to make than the small ones!

Small ones as Py3, doesn't deserve a major version boost. It simply doesn't have that much to offer.

Re: Extend Python 2.7 life till 2020

#173

Earlier quoted context omitted.

Well honestly, python 2* is a lot more convenient to write in a lot of ways, and the benefits of 3 aren't big enough to make up for it for a lot of people/use cases.

> 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".

can't use print x anymore, which also gets rid of "print x,", which printed something without making a newline, for one thing.

Re: Extend Python 2.7 life till 2020

#174

Earlier quoted context omitted.

Actually it's a procedure because it has a side-effect.

In python, they are called "functions" whether or not they have side effects. (And, actually, in most programming languages I've seen that have different constructs called "function" and "procedure", the difference is that functions have a return value and procedures don't -- usually, both can have side effects.)

Have you ever used a functional programming language?

Re: Extend Python 2.7 life till 2020

#175
post #148

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? This bothers/worries me, because I don't understand where this notion that "learning Python 3" requires significant effort or commitment comes from. Python 3 isn't massively different from Python 2. I learn more "new stuff" (APIs I've never used befor…

It's not about the language. Languages are easy to learn. I can learn one between breakfast and lunch and be productive by dinnertime. I use Python 2 because of the massive ecosystem of libraries that have been written, work, and will continue to work. It's shortsighted and more than a little irresponsible to shame or muscle people into switching. Code that works is valuable. Code that has been tested for a decade is…

> It's not about the language.

It was for the OP. Can't fault me for my reply not reading on an argument you make after the fact :).

> I use Python 2 because of the massive ecosystem of libraries that have been written, work, and will continue to work.

I too like useful libraries that save me time and effort, and I agree that Python 2 is extremely strong there. I feel like Python 3 is catching up and has a pretty good library story going for it already (my gratitude to those who make that happen through their contributions), in addition to being a language I find more enjoyable and productive to use than Python 2.

> It's shortsighted and more than a little irresponsible to shame or muscle people into switching.

I don't think I've done either, and I think you're being quite rude here. I was merely voicing my opinion that the magnitude of the differences between Python 2 and 3 gets blown out of proportion. Please be mindful of the context.

> that nobody wants to upgrade to

Not so, I've wanted to and have upgraded things to Python 3, and so have others.

As for the whole "forcing" stuff - well, yes, it happens. As a user of a language you're part of a community, and communities can sometimes decide to go into a direction you don't agree with. It's frustrating and difficult, and you can reasonably decide that it's a deal-breaker and leave the community. Often however it's valuable to instead put one's efforts into achieving consensus, and then defending and carrying that consensus, even if it's not what you originally wanted - shit tends to get done faster then, to the benefit of all.

Re: Extend Python 2.7 life till 2020

#176

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".

can't use print x anymore, which also gets rid of "print x,", which printed something without making a newline, for one thing.

  print(x, end='')
Not quite as nice, but not exactly unusable.

https://docs.python.org/3.1/library/functions.html#print

Re: Extend Python 2.7 life till 2020

#177
post #29

Earlier quoted context omitted.

A bit off topic, but what exactly makes boto so hard to port to Python 3? Whenever I look at this page I am puzzled by it still not supporting Python 3

There is a port in the works [0], and apparently they decided to go with a rewrite instead of just a port. I'm not sure of the exact reasoning, but that could explain why it takes them time. [0] https://github.com/boto/boto3

There has certainly not been a lack of work on porting, there was the neo branch as well, there is some interesting (for some values of interesting) discussion about the approaches to 2.x and 3.x compatibility:

https://github.com/boto/boto/issues/1127

and also the py3kport branch:

https://github.com/boto/boto/tree/py3kport/py3kport

Re: Extend Python 2.7 life till 2020

#178
post #115

Earlier quoted context omitted.

Hm that does sound clever. A preparser to determine what language version then invoke that interpreter. And if the 3 is so good people would switch over to usong its features only very soon. Maybe py3 just doesnt have good enough features compared to 2 for people to make the switch and shouldnr have existed in the first place? But gradually introducing changes. Now python is for all intents two languages instead of o…

It's not possible to determine the language. The extensions are the same and much of the syntax hasn't changed, and many of the backwards-incompatible differences are subtle. Python2: print(1/2 * 1000) # 0 print({b'a': 'bytes', u'a': 'text'}[b'a']) # text print(b'A'[0]) # A Python3: print(1/2 * 1000) # 500 print({b'a': 'bytes', u'a': 'text'}[b'a']) # bytes print(b'A'[0]) # 65 And the merits of doing a backwards-incom…

Python3's treatment of integer literals in that case is bad. The first is the behavior that someone used to programming will expect by default, since those are integers. If you want non-integer operations you should have to use a decimal point in the 1 or 2.

Re: Extend Python 2.7 life till 2020

#179
post #175

Earlier quoted context omitted.

It's not about the language. Languages are easy to learn. I can learn one between breakfast and lunch and be productive by dinnertime. I use Python 2 because of the massive ecosystem of libraries that have been written, work, and will continue to work. It's shortsighted and more than a little irresponsible to shame or muscle people into switching. Code that works is valuable. Code that has been tested for a decade is…

> It's not about the language. It was for the OP. Can't fault me for my reply not reading on an argument you make after the fact :). > I use Python 2 because of the massive ecosystem of libraries that have been written, work, and will continue to work. I too like useful libraries that save me time and effort, and I agree that Python 2 is extremely strong there. I feel like Python 3 is catching up and has a pretty goo…

I didn't mean to be rude. I'm sorry if it sounded that way. I think it's both shortsighted and irresponsible to force people to abandon libraries that work.

The parent poster wasn't concerned about learning the language. They were concerned about dependencies that work, which is what I was saying:

"I care about getting my python script working as soon as possible and for a foreseeable future - I couldn't care less for the Python language and it's future."

Yes, I didn't mean "nobody" literally. I should have said "few."

Re: Extend Python 2.7 life till 2020

#180

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".

On both OSX and many Linux distros, Py 2 comes pre-installed but Py 3 does not. If I'm going to write simple scripts that I'm going to give out to people, it's nice not having to worry about them needing to fuck around to get the script to run.

> On both OSX and many Linux distros, Py 2 comes pre-installed but Py 3 does not.

Because python 3 was not the most stable at the time of distribution of that operating system. Why would I the developer of said operating system release anything but the most stable versions of the language? This would in turn make my operating system at times less stable.

Post reply on HN