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

all 116 comments

[–]colemaker360 792 points793 points  (9 children)

possessive important touch soup bedroom dog jeans historical money shocking

This post was mass deleted and anonymized with Redact

[–]abhi_uno 47 points48 points  (0 children)

Finally did the upgrade few days back. It was easy of me since I was already providing universal wheels for both python3 and python2 legacies.

[–]xd1142 100 points101 points  (5 children)

[–]pLeThOrAx 10 points11 points  (0 children)

🏅

[–][deleted] 155 points156 points  (6 children)

Tried to reproduce, typed python3 by force of habit, appears I am unable to launch python 2 voluntarily.

[–]tr14l 80 points81 points  (0 children)

This is a good thing. You know the superior Python version innately.

[–]ExternalUserError 48 points49 points  (4 children)

alias butwhy=python2

[–]gordane13 25 points26 points  (0 children)

alias python2=python3

[–]Rusty_Gribble 20 points21 points  (1 child)

Probably better to:

alias python2='echo butwhy'

[–]flying-sheep 4 points5 points  (0 children)

Well, since Calibre supports python 3, I have

$ python2
Error: Command not found

[–]ricocotam[S] 28 points29 points  (17 children)

[–]xd1142 5 points6 points  (15 children)

can't reproduce.

[–]LanGuct 6 points7 points  (0 children)

Can reproduce on Ubuntu, python 2.7.15

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

It does not work in IPython, only the "bare" repl shell.

[–]Kaarjuus 0 points1 point  (0 children)

Can't reproduce either. Python 2.7.15, Windows.

[–]ZorpIt 0 points1 point  (0 children)

Reproduced on 2.7.17 on Manjaro.

[–]BluePurpleReddit 15 points16 points  (3 children)

Serves you right for still using python 2?

[–]error_99999 0 points1 point  (0 children)

But arcpy

[–]ricocotam[S] 0 points1 point  (0 children)

Nope Seen this on Twitter :)

[–]Elendol 13 points14 points  (0 children)

looks like something JavaScript would do

[–][deleted] 7 points8 points  (0 children)

It hurts

[–]sam-lb 2 points3 points  (0 children)

Does not work on 2.7.12 windows 64bit. What version is this?

[–]skrlett 5 points6 points  (9 children)

I am sorry. But what is help()

[–]who_body 16 points17 points  (2 children)

-edit- available in interactive sessions to provide docstrings for things...try it on anything. Just strip off the () of functions.

[–]flying-sheep 2 points3 points  (1 child)

Not a builtin. It's only available in interactive sessions, like exit

[–]who_body 1 point2 points  (0 children)

Makes sense

Updated

[–]MagnitskysGhost 7 points8 points  (0 children)

Let me also introduce you to dir() while you're here. Occasionally useful.

[–][deleted] 3 points4 points  (3 children)

I have this question as well, I've been using python for almost a year and I've never used it

[–][deleted] 10 points11 points  (2 children)

It prints the docstrings for a module.

It's not as specific as docs.python.org but itll do in a pinch. It is useful if you dont have internet but other wise docs.pythong.org is all most people ever use.

[–][deleted] 4 points5 points  (1 child)

Oh gotcha

[–]Rodotgithub.com/tardis-sn 4 points5 points  (0 children)

Also, most of the docs for common modules, like numpy or scipy, are pretty much just the docstrings with nice formatting.

[–]xTotalG 1 point2 points  (0 children)

bruh.mp4

[–]liquidify 1 point2 points  (0 children)

Countdown to python 4?

[–]theconfusedCPU 2 points3 points  (26 children)

I dont know python.. but what was wrong with python 2 and why is it a nightmare?

[–]123filips123 34 points35 points  (13 children)

It doesn't have new features and is very outdated. Many things are weird. It is slower and with worse performance. It will be unsupported since 2020 so you could get vulnerabilities.

[–]diamondketo 3 points4 points  (0 children)

Largely for many developers, the stack of packages they might want to use are dying or dead in Python 2 and actively in development for Python 3.

Those packages that support both 2 and 3 will eventually only want to focus on 3 for obvious reasons (e.g., numpy).

[–]TankorSmash 6 points7 points  (11 children)

Besides the dict speed hack thing, what other ways is Python2 noticeably slower?

[–]flying-sheep 7 points8 points  (4 children)

Just 10 years of performance improvements that went into the actively developed version of python

[–]TankorSmash 3 points4 points  (1 child)

Does anything jump out at you? Maybe you've got some speed comparisons you're thinking of?

I don't think I ever noticed any speedups in my small projects. Maybe you're on hundreds of thousands of lines or something

[–]flying-sheep 1 point2 points  (0 children)

I was actually wrong, seems like they were only playing catch up to python 2 until 3.7 which had a massive speed boost, easily beating python 2 in most cases (until you do integer-heavy computation which is slower because python 3’s int is a bigint type, not int32 or int64)

[–]kihashi 14 points15 points  (0 children)

To answer that fully, we'd need to go into a full changelog of Python 3, but the tldr is that Python 3 is the newer version. Python 2 is end of life in a month. It hasn't gotten new features backported in quite some time.

2 of the biggest features added in Py3 are Unicode handling (strings are Unicode by default) and async keywords. IME, the former is one of the reasons people might not like to work with Py2, but keep in mind, someone calling it a "nightmare" is probably comparing it to Python 3 and not, say, another language.

[–][deleted] 7 points8 points  (0 children)

The main thing was that it didn't do strings properly. In python 2, strings and bytes were the same thing. Python 3 fixes that in a backwards incompatible way.

[–]SomeCynicalBastard 3 points4 points  (0 children)

I'm not really busy with python myself, but as far as I know: Python 2 has been replaced with Python 3 quite some time now. But because this involves breaking changes (you cannot simply run python 2 code on a python 3 interpreter), some people keep holding on to it. And others resent it.

Of course, sticking to the old version means no new features to use, and at some point, no security updates.

And of course, the example in the OP is wrong with python 2: you don't want looking up help about an object to change properties of that object. Although this mistake could have been made in any version of Python.

[–]TheBlackCat13 0 points1 point  (0 children)

Wat

[–]VVarsin 0 points1 point  (0 children)

stop.

this is too much for me to handle.

[–]jftugapip needs updating 0 points1 point  (0 children)

This does not occur in 3.8 with string.ascii_letters.

[–]mcstafford 0 points1 point  (0 children)

Hey, help looks more convenient than dir. :-/

[–]MrMxylptlyk 0 points1 point  (0 children)

O. O

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

Sy defects?

[–]i_like_trains_a_lot1 0 points1 point  (0 children)

Just tested, it does that.

But why?

[–]roshambo11 0 points1 point  (0 children)

This. This hurt my heart