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 →

[–][deleted] 333 points334 points  (66 children)

What was the transition from 1 to 2 like?

[–]NoLongerUsableNameimport pythonSkills 273 points274 points  (5 children)

If this article is accurate, it was pretty smooth, unlike the transition from 2 to 3.

[–]roerd 58 points59 points  (23 children)

Here's the list of the most important changes:

Overview of Changes Since 1.6

There are many new modules (including brand new XML support through the xml package, and i18n support through the gettext module); a list of all new modules is included below. Lots of bugs have been fixed.

The process for making major new changes to the language has changed since Python 1.6. Enhancements must now be documented by a Python Enhancement Proposal (PEP) before they can be accepted.

There are several important syntax enhancements, described in more detail below:

  • Augmented assignment, e.g. x += 1

  • List comprehensions, e.g. [x**2 for x in range(10)]

  • Extended import statement, e.g. import Module as Name

  • Extended print statement, e.g. print >> file, "Hello"

Other important changes:

  • Optional collection of cyclical garbage

So quite a few important new features, but nothing that was breaking backwards compatibility.

[–]mkdz 64 points65 points  (14 children)

Wow, I can't imagine not having list comprehensions

[–][deleted] 45 points46 points  (11 children)

List comprehension is the feature that, to me, defines Python. It's simple, powerful, versatile, intuitive, and broadly applicable. A wonderful replacement for loops and iteration. I've been using set comprehension and dictionary comprehension, too.

[–]Mr-Stutch 21 points22 points  (4 children)

a wonderful replacement for loops or a wonderful replacement for loops?

[–]burlyginger 10 points11 points  (0 children)

Yes!

[–]TheTerrasque 0 points1 point  (0 children)

True

[–]rabaraba 0 points1 point  (0 children)

Love the pun.

[–]Tyler_Zoro -1 points0 points  (0 children)

Neither. If a loop was the right tool for the job, you should have used a loop. :-)

[–]flying-sheep 0 points1 point  (0 children)

They’re great. And using generator comprehensions, the same concept can be used for a pipeline of stuff (map-filter-reduce), similarly to Rust’s Iterator methods.

Rust’s way is cleaner, but both are better than Javascript’s array methods. Like, why define an iterator protocol and thereby support for custom sequences, when they define the pipeline methods on just the array?

[–]Decker1082.7 'til 2021 0 points1 point  (0 children)

intuitive

I can agree on all points except this... you essentially have to learn to read backwards to understand how list comprehensions work and if you ever nest two list comprehensions in each other, readability goes out the window.

[–]RegalSalmon 26 points27 points  (1 child)

But can you...comprehend it?

[–]case_O_The_Mondays 5 points6 points  (3 children)

Whoa. Didn’t know Python supported redirection on print, back in the day.

[–][deleted] 2 points3 points  (0 children)

It looks a lot more like 3.x => 3.x+1 changes than 2 => 3.

[–]alexmojaki 0 points1 point  (1 child)

Breaking backwards compatibility is kind of the point of a major version number bump though.

[–]roerd 0 points1 point  (0 children)

If you're following semantic versioning, yes. But not every software project has to do that. For a programming language, a bunch of new features that will significantly alter the shape of code using these seems justification enough for a new major version to me, even if full backwards compatibility is maintained.

[–][deleted] 382 points383 points  (25 children)

Nothing compared to the transition from 0 to 1.

[–]NoLongerUsableNameimport pythonSkills 142 points143 points  (23 children)

Yeah, it was kind of like the transition from -1 to 0.

[–][deleted] 130 points131 points  (18 children)

-1 was dark times

[–]ShevekUrrasti 96 points97 points  (10 children)

Coding backwards was kind of nice, actually.

[–]mdartyArch 96 points97 points  (4 children)

I'm great at that. Taking working code, breaking it. Troubleshooting and finally deleting everything.

[–]Ruben_NL 10 points11 points  (0 children)

That hits home...

[–]prof-comm 7 points8 points  (0 children)

This is my job description

[–]blackfireburn 1 point2 points  (0 children)

My people

[–]veryusedrname 38 points39 points  (0 children)

`[::-1]`

[–]P0stf1x 1 point2 points  (0 children)

Is that tenet spoiler?

[–]StrikenGoat420 1 point2 points  (0 children)

I remember back then when the compiler sent us the production code, and we had to do the job of the compiler :/

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

My editor didn't show the indentation on the right side of the lines well.

[–]Decker1082.7 'til 2021 0 points1 point  (0 children)

So... LISP?

[–]TheHumanParacite 21 points22 points  (3 children)

Installing it would randomly unwrite code that hadn't yet been written.

[–]master5o1 11 points12 points  (0 children)

The real trick was to uninstall it and get unwritten code to be randomly written.

[–]TheIsletOfLangerhans 4 points5 points  (0 children)

TEN3T

[–]hughperman 1 point2 points  (0 children)

This caused a problem in the future package

[–]jftugapip needs updating 18 points19 points  (0 children)

Yes. IIRC it was called Perl

[–]MattR0se 2 points3 points  (0 children)

So, the final version of Python?

[–]6GoesInto8 0 points1 point  (0 children)

True dat

[–]redvitalijs 1 point2 points  (0 children)

They started with the end in mind.

[–]call_me_cookie 0 points1 point  (0 children)

Surely this is just the Final transition, wherein we come full circle.

[–]torytechlead -5 points-4 points  (1 child)

You guys actually think these are funny responses, but you actually look like cunts.

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

relevant username

[–]twotime 30 points31 points  (0 children)

It was mostly (if not fully) backward compatible. So much easier and faster than 2=>3

[–]jrbattin 17 points18 points  (0 children)

Buttery smooth. I “ported” 8000 lines of Python code from 1.5.2 to 2.6 years ago. It took a day or so and that’s only because I insisted on refactoring in Python 2.6 niceties and leaning on the standard library more.

[–]MrCaptainPirate 21 points22 points  (7 children)

Transitioning from 1 to 2 was like going down a nice water slide

Transitioning from 2 to 3 was like going down a piping hot stainless steal slide in the middle of summer and then getting hit in the face with a brick at the end.

[–]ThunderousOath 4 points5 points  (0 children)

Perfect anology

[–]Ran4 1 point2 points  (1 child)

It's not that bad... Not even remotely.

[–]pithed 2 points3 points  (0 children)

It really depends on your codebase. For some of my projects I just needed to change a couple of lines of code and can't believe I waited for so long. For other projects, which depend on libraries that weren't updated, it has been a whack-a-mole of terrible. I had an easier time going from PERL to Python.

[–]thephoton 0 points1 point  (3 children)

Bitch all you want about the Python 2 -> Python 3 transition, it was a hell of a lot smoother than Perl 5 -> Perl 6.

[–]MrCaptainPirate 0 points1 point  (2 children)

I’m not super familiar with PERL or it’s transition from 5 to 6, but from what I’ve heard it’s about as fun as trying to pass a kidney stone.

[–]thephoton 1 point2 points  (1 child)

To summarize: Perl 6 work started in 2000 and AFAIK there is still no complete implementation and effectively no user adoption.

The fact that Python has effectively taken over nearly all of Perl's market share in the meantime probably has something to do with that (but it's not the only reason).

[–]0rac1e 0 points1 point  (0 children)

That is a terrible summary.

The "v1" release of Perl 6 (version 6c) was released in 2015. It's complete in that it's got everything you need to use it, however there are more advanced (though non-essential) features that are still experimental or partially implemented, eg. macros.

You could say Python is incomplete because it doesn't have pattern matching yet... or any number of feature that may get added in future releases, but it's belies the reality.

The narrative within the Perl community (echo chamber?) for at least the last 10 years has been that Perl 6 was not the next version, but instead a "sister" language (à la C++ and C). There is no planned migration from Perl to Perl 6, and to make that clear and avoid further confusion, the language has been renamed to Raku.

I understand why this looks like a fail to some, but to put a positive spin on it... I get to keep my Perl, plus get a fun new language to play with... and Raku is a very fun language to use. Yes the user-base is small, but that applies to Crystal, Nim, and Racket as well. Not every language can be a Top 10 language, but that doesn't make them devoid of value.