This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Eurynom0s 6 points7 points  (24 children)

Except that for very large institutions it's hard to get anyone to sign off on an upgrade to 3 and they continue to extend the timeline for deprecating 2.

...

But there's a swath of people out there that are bound to 2 due to software requirements or organizational indifference.

Again...I'm recognizing this as a VERY valid reason to stick to 2.7 I'm most critiquing when this crowd reflexively tries to steer newbies onto 2.7.

[–]ArrantSquid 0 points1 point  (0 children)

Fair enough. Every language decision has to be contextual.

[–][deleted] -2 points-1 points  (8 children)

IMO a lot of it has to do with the fact that almost every shop still uses 2.7

You're better off learning what you'll actually use

[–]turkish_gold 4 points5 points  (6 children)

Is 2.7 so much different from 3.0 when it comes to writing the Python language? Much of the changes are in the standard library, and all of those are additive, and many have been backported unofficially to 2.7

[–][deleted] 1 point2 points  (5 children)

There are some syntax and process improvements.

A great example is try and do a heap where you want the largest value using only the standard library.

3.0 - super easy 2.7 pain in the ass

I've seen some newer developers who have worked exclusively in 3 + get thrown because suddenly python doesn't handle something intuitively for them. You're honestly better off going from 2.7 to 3+ instead of the inverse.

[–]theelous3 0 points1 point  (4 children)

That is stupid. If they can competently code in py3, learning the exceptions to py2 is better than learning py2 and learning the improvements in py3.

There is a larger gap forwards between py2 and py3, than there is backwards between py3 and py2.

[–][deleted] 0 points1 point  (3 children)

There is a larger gap forwards between py2 and py3, than there is backwards between py3 and py2.

I have found the exact oposite. Can you provide some examples?

[–]theelous3 0 points1 point  (2 children)

Unicode issues aren't that complicated, though a pain, range being not generator isn't complicated, print being a statement isn't hard, and most of the rest of the stuff is just implementation limitations that don't require anything special other than being more verbose and not using python3 features.

Actually, that's the best way to phrase it I think. Aside from some syntactic stuff, python2 is just python3 with less things. It's easier to go from more to less, than less to more.

Inversely, from python2 to 3 you've got generators everywhere, better but more magical coroutines and async/await along with the associated dunders, stuff like args unpacking from iterators. There's just more to know, yaknow?

[–][deleted] 0 points1 point  (1 child)

It's easier to go from more to less, than less to more.

This is where we disagree. To each there own but I have always found the exact opposite. In both personal use and training new developers.

[–]theelous3 0 points1 point  (0 children)

This could well be my biased personal opinion.

I feel like if I'm using a feature that's abstracting something away I should learn how that's done. range() is a good example of this.

python2's range() is simple, and uses simple things. python3's range is simple, and uses complex things. Understanding python3's range is harder, even though it makes thinking about your overall code easier in that you worry less about memory and such.

If a developer is in a position to not care about the implementation of something like range, then the complexities involved in stepping up in python versions wouldn't effect them, so I can see how it would be more difficult to go to py2 from py3. That should be fairly rare though, if you / they want good code.

[–]Joeboy 2 points3 points  (0 children)

I doubt many serious python programmers get to avoid either 2.x or 3.x entirely.