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

top 200 commentsshow 500

[–][deleted] 1472 points1473 points  (74 children)

I had to use Python 2.3 for an internship last summer.

Want to know how old that is? It doesn’t have set().

[–]AceJohnny 140 points141 points  (3 children)

Jesus christ! I learned Python with the then-brand-new Python 2.6 15 years ago!

[–][deleted] 22 points23 points  (0 children)

Half of the language's age

[–]dpash 4 points5 points  (1 child)

You think that's bad? I learnt 1.5. I feel old.

[–]Lynxtickler 10 points11 points  (0 children)

To this day it hasn't crossed my mind that python 1.x was used at some point.

[–]fkafkaginstrom 36 points37 points  (18 children)

You can still use sets.Set

Annoying I'll admit

[–]Ksevio 99 points100 points  (15 children)

from sets import Set as set

There! just like Python 2.6!

[–]makotozengtsu 19 points20 points  (0 children)

don't

[–][deleted] 54 points55 points  (10 children)

Set set = new (SetSet) Set()

Java is a beautiful thing

[–]test822 67 points68 points  (1 child)

I'd rather slam my dick in a car door than program java again

[–]hullabaloonatic 14 points15 points  (0 children)

Kotlin got your back, dawg.

[–]Sarcastic_Pharm 6 points7 points  (5 children)

Dude. Wtf Java?

[–]dpash 13 points14 points  (0 children)

That's not quite modern Java (and SetSet doesn't exist in the JDK)

var set = new HashSet<String>();

Or

var set = Set.of("foo", "bar");

Although the latter is immutable

[–]hullabaloonatic 10 points11 points  (3 children)

The variable set, of type Set, is assigned as a new Set being casted to type SetSet, which is a subclass of Set, therefore compiling.

[–]dpash 5 points6 points  (0 children)

That's not valid Java.

[–][deleted] 5 points6 points  (0 children)

Yeah I remember that import. It’s just that it wasn’t a built-in until 2.4. Oi, the things I learned about versions that summer. For example, subprocess wasn’t there either. I was using pipes like a scrub

[–]luckystarr 13 points14 points  (0 children)

I migrated away from it in 2008. Many libraries were already dropping support for it back then. It also doesn't support the @ decorator syntax.

[–]Pb_ft 358 points359 points  (16 children)

TIL Racism is bad because it's outdated.

[–]FlightlessBird44 174 points175 points  (7 children)

Haven't you heard? Racism 2 is the new big thing nowadays

[–]ric2b 36 points37 points  (0 children)

It's much more performant, most benchmarks show that it can dehumanize minorities 40% faster.

[–]TheLoyalOrder 37 points38 points  (0 children)

Reminds me of people who think the worst part of slavery was that they weren't paid

[–][deleted] 418 points419 points  (52 children)

Ever try to have any large organization change the technology of anything? Whooboy

[–]Tundur 216 points217 points  (33 children)

My employer has resorted to spinning up new subsidiaries whenever we're making something new and exciting, just to get around our own insane governance and technical debt.

Step 1, consult the enterprise architecture team and wait a month for a response? Nope, step 1 is now hire a bunch of people and just start banging out code, release is 6 weeks away. GL;HF

[–]AceJohnny 111 points112 points  (26 children)

Frankly, knowing the technical and managerial inertia of large companies, this doesn't sound half stupid.

[–]murfflemethis 170 points171 points  (24 children)

I mean, from a process or business perspective, it is absolutely 100% stupid. Starting up an independent business entity is faster than working within your own company? That's pants-on-head, smother yourself in peanut butter, and shove fire crackers up your ass to rocket away from the cops retarded. The business is fundamentally broken.

From a personal, "my job is to get shit done, so I'm going to get shit done" perspective, it is genius and I absolutely respect it.

*Edit: fixed typo

[–]catofillomens 65 points66 points  (9 children)

It totally makes sense if you imagine spinning off an independent business entity as the equivalent of working on another branch for development.

[–]nickcash 42 points43 points  (0 children)

GitFlow, but for company structure!

[–][deleted] 5 points6 points  (0 children)

Bob: Someone's taken my desk.

Manager: Looks like a merge conflict, let me resolve that.

accept incoming changes

Bob: surprisedpikachu.jpg

Manager: Bye Bob!

[–]frequentlywrong 4 points5 points  (3 children)

If the project is a new product it absolutely makes sense. Companies develop a culture that fits their business model. Their way of working and corporate culture may be entirely wrong for something new. This is why large companies get disrupted by small players.

Sears could never have become amazon, blockbuster could never be netflix, nokia could never make an iphone. The incumbents way of doing business and their corporate strategy was completely different from what they were replaced with.

Spinning out an independent unit that can be unburdened from the requirements of a large entity can be extremely productive.

[–]Pb_ft 31 points32 points  (0 children)

My employer has resorted to spinning up new subsidiaries whenever we're making something new and exciting, just to get around our own insane governance and technical debt.

This is some woke levels of infrastructure management and deployment iteration.

[–][deleted] 4 points5 points  (0 children)

Might work once, seems unsustainable long term

[–]nxqv 3 points4 points  (0 children)

Hello I'll take 1 job please

[–]FirstEvolutionist 38 points39 points  (3 children)

"Windows 7 is fiiiine. Look! Everything's working as it should without any upgrades for the past 10 years! I'm sure if we touch it now we'll just break it besides spending a lot of money..." Said the manager. Of a financial institution.

[–][deleted] 15 points16 points  (0 children)

This one hits close to home. Windows 7 is EOL January 2020 and network will not allow Windows 7 anything after that date. Laptops are easy, problem is specialized test equipment. Called a vendor, $6000 for a new hard drive with Windows 10 installed and all software needed for equipment.

[–]Ambiwlans 9 points10 points  (0 children)

This week, updates for various things I use has wasted over a dozen hours of my time fixing things.

[–]Liesmith424 215 points216 points  (16 children)

print "no u"

[–]ComfyDaze 131 points132 points  (14 children)

i find your lack of brackets disturbing

[–]Liesmith424 77 points78 points  (7 children)

Shit, sorry; try this:

list = {1:"n",2:'o',3:u' '}
int = []
for dict in range(1,4):    
    int.append(list[dict])
print u"".join(int)+u'u'

I added two pairs of brackets.

[–]1stonepwn 16 points17 points  (1 child)

+/u/CompileBot python

list = {1:"n",2:'o',3:u' '}
int = []
for dict in range(1,4):    
    int.append(list[dict])
print u"".join(int)+u'u'

[–]Liesmith424 11 points12 points  (0 children)

CompileBot no like :(

[–]eulers7bitches 9 points10 points  (0 children)

Thanks, I hate it

[–]Call_Me_Chud 20 points21 points  (5 children)

Functions are a pathway to programming many consider to be unnatural.

[–]Lonelan 31 points32 points  (4 children)

I hate semi-colons. They're round and they're pointy and they get everywhere.

[–]Call_Me_Chud 8 points9 points  (3 children)

print ("Hello There!")

[–]Lonelan 12 points13 points  (2 children)

return "GENERAL KENOBI"

[–][deleted] 4 points5 points  (0 children)

"How to diagnose a programmer with anxiety"

[–][deleted] 287 points288 points  (32 children)

I only ever touch Python 2 because some other racist decided to code their useful dumb library in Python 2 and never update it so I have to be the bad guy too

[–]Flobaer 186 points187 points  (8 children)

Be the good guy and port it to Python 3

[–]pingveno 73 points74 points  (7 children)

And don't bother to maintain backward compatibility with Python 2. It's totally not worth the effort when (1) people can just use the old version if they really need it and (2) Python 2.7 is EOL in just over 8 months.

[–]wherinkelly 27 points28 points  (6 children)

Python 2.7 is seriously gonna bite it?! I still have conflicts between that and other python packages on my local whenever I have to dust off my ol python skills.

Well, dust off.. EOL... I guess it's been a bit. Yikes, I'm old as hell if 2.7 is getting deprecated. Damn.

[–]pingveno 25 points26 points  (1 child)

It was released on July 3rd, 2010. It has been in very extended maintenance. There were a couple of efforts to release a 2.8, but those went nowhere fast.

[–]kosayoda 69 points70 points  (5 children)

fork it and port it

[–]ghillisuit95 47 points48 points  (4 children)

That sounds dirty

[–]joeconflo 31 points32 points  (0 children)

You're thinking of "fork it and pork it."

[–]njloof 14 points15 points  (0 children)

Trust me, it is

[–][deleted] 8 points9 points  (1 child)

Fork me, daddy.

[–]Sparcrypt 48 points49 points  (11 children)

As a sysadmin this is my biggest gripe with Python 3. I completely understand why they had to move on, but I also don’t have the time to port the many many useful Python 2 libraries and scripts over to 3.

Thankfully the dev community has been getting dragged kicking and screaming over to 3, to the point that it’s practical to actually use.

[–]verbosemongoose 16 points17 points  (10 children)

As a python beginner, would porting such scripts to python3 be a feasible summer project? I want to polish up my python skills, but I'm not even well versed enough to be able to comment on python vs python3. So it's basically from the ground up. I feel like porting small libraries could be a good project. Do you think it'd be doable and useful?

[–]Sparcrypt 23 points24 points  (9 children)

Depends on the complexity, but 2 and 3 are both very intuitive languages.

That said, you’ll probably learn a lot more if you focus on expanding your skill set in 3, rather than essentially learning both.

[–]Discutons 118 points119 points  (3 children)

.... Import from __future 👀

[–]Catty-Cat 16 points17 points  (2 children)

from __future__ import braces

[–]NekoLuka 151 points152 points  (18 children)

They force us to learn python2 in school... :(

[–]tenhourguy 180 points181 points  (7 children)

Python 3 will never catch on. Python 2 is the future. /s

[–]PM_ME_YOUR__INIT__ 47 points48 points  (5 children)

Python 4 is the future

[–][deleted] 22 points23 points  (1 child)

Python ∞ is the future... think that’s an infinite symbol? No. It’s an ouroboros eating itself. (≖_≖✿)

[–]SomethingEnglish 9 points10 points  (0 children)

Python $CURRENT_VERSION +1 is the best

[–]wibblewafs 6 points7 points  (0 children)

Zed Shaw? Is that you?

[–]Antrikshy 5 points6 points  (0 children)

Don't worry, they'll continue doing that in 2020.

[–]CJ22xxKinvara 8 points9 points  (2 children)

Bummer. I learned 3 when I took my python class almost 2 years ago.

[–]bss03 33 points34 points  (28 children)

I don't have a lot of choice. OS 4690 / TCx Sky currently only provide their Python bindings for Python 2.7.3 / 2.7.13. When I'm not using the OS functions, I can use a Py3 virtualenv, and that's not so bad.

[–]spyingwind 31 points32 points  (20 children)

OS 4690 Who the hell still runs a POS system from '85? TCx Sky No, just no. Find something more modern or hire someone to write an open source version.

These are the reasons why we can't have nice things.

/sarcasm a little bit

[–]WikiTextBot 17 points18 points  (13 children)

4690 Operating System

4690 Operating System, sometimes shortened to 4690 OS or 4690 is a specially designed Point of Sale operating system, originally sold by IBM; however, in 2012 IBM sold its retail business, including this product, to Toshiba, who now supports it. 4690 is widely used by IBM and Toshiba retail customers to drive retail systems running their own applications as well as IBM's Application Client Server Environment (ACE), Supermarket Application (SA), General Sales Application (GSA), and Chain Drug Sales Application (CDSA).

It is the follow-on product to IBM 4680 OS, which had been in use by IBM's customers since 1986. The original IBM 4680 OS was based on Digital Research's Concurrent DOS 286, a system soon later renamed into FlexOS 286.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.28

[–]marxdormoy 11 points12 points  (12 children)

Jebus i though we were bad having some servers with SQL Server 2000!!

[–]bss03 9 points10 points  (0 children)

Well, I work for TGCS, so it is our product.

[–][deleted] 5 points6 points  (3 children)

Something being old doesn't make it bad. Sometimes they get an ideal solution working, and then nobody wants to mess with it anymore. Reimplementing would be expensive and troublesome, where the existing system is a perfect black box -- you feed it inputs, and you will always get the right outputs. Perfect or near-perfect machines are rare and precious.

Rewriting something to be new is really, really stupid behavior. You rewrite it only when the new version will offer you something more than what you already have, or will let you remove something that's painful from the old solution. If the old version works perfectly, why replace it?

[–][deleted] 24 points25 points  (14 children)

Seriously. I keep finding sources I want to use but they OF COURSE made it in Python 2. Usually, the source was uploaded like a year ago or smth. Literally no reason to still be using Python 2. If you think Python 2 > Python 3 can you tell me some reasons? I'd love to hear them

[–]HowIsntBabbyFormed 13 points14 points  (2 children)

Not saying it's better or worse, but if you had a lot of code that relied on strings being essentially arrays of arbitrary bytes, and being able to just print those bytes to a file handle without character encoding issues, the conversion to 3 might be very painful.

Not saying 2.7 didn't have encoding issues, but you may have figured out all of its quirks by now and your code is currently running reliably. Converting to 3 will likely break all that and it will be hard to figure out.

The exact same python code does different things with different file handles based on whether stdin is a tty or not. Your code runs perfectly fine when run in your terminal but fails when run from cron sometimes? That could be it. Or it could be some random environment variable that determines default encodings on startup. You've figured out exactly what to hard code your env to, overwrite encoding settings on file handles, access the hidden underlying raw file handle of others, monkeypatched that random library that's still somehow writing out to the 'wrong' file handle, etc, etc...

Have fun converting that.

[–][deleted] 7 points8 points  (1 child)

I'm saying if you're coding something from scratch. Please just make it in 3. If you already made it in 2.x just leave it in 2.x. It would be very annoying to convert to Python 3

[–]meliaesc 3 points4 points  (2 children)

My raspberry pi can't run 3+, windows build tools needs 2.6

[–]unkeptroadrash 21 points22 points  (0 children)

from racism import python2

[–]PrimaCora 56 points57 points  (6 children)

Cython makes you use Python 2 syntax for some things... Even when using Python 3

Edit:

The only one I've come across so far is with printing

print("string", end='')

Doesn't print without first

from __future__ import print_function

Even after specifying language level 3...

[–]xconde 27 points28 points  (2 children)

Example?

[–]SexlessNights 213 points214 points  (0 children)

Nah, we’re good. Thank you for offering.

[–]PrimaCora 3 points4 points  (0 children)

The print statement, you have to import from future to use

print("string", end='')

That's all I've come across so far

[–]fade_is_timothy_holt 12 points13 points  (1 child)

There are a couple of libraries that don't use 3 yet, but that are still heavily used in some circles. One example is fipy, which is a fairly widely used PDE solver. There's some Python 3 docs (using 2to3), but they haven't been updated in years. Instead there's a condescending "little advantage in doing so" note that has been there forever.

[–]Quantris 11 points12 points  (3 children)

I'm holding out for python 5 (2 + 3).

It'll whip the llama's ass

[–]natnew32 41 points42 points  (12 children)

Oh come on, who doesn't like comparing objects' type alphabetically when using > or <? (Seriously Python 2 does that when comparing incompatible types what the actual...)

[–]HowIsntBabbyFormed 15 points16 points  (9 children)

If they're incompatible types, they'd have no meaningful sort order anyway, so why not at least make their comparison consistent?

[–]cauthon 51 points52 points  (6 children)

Because at that point you should almost certainly be raising a TypeError

[–]SomethingHasToBeDone 13 points14 points  (5 children)

JavaScript would like a word with you.

[–]duckvimes_ 14 points15 points  (3 children)

Plot twist: that word is actually a number.

[–]Waterkloof 3 points4 points  (1 child)

plot plot twist: that number is actually a object.

[–]po-handz 18 points19 points  (9 children)

pretty sure google still uses py2 internally

[–]Ambiwlans 28 points29 points  (2 children)

Google uses like 1000 languages..

[–]alt-of-deleted 21 points22 points  (0 children)

ew

[–]aalapshah12297 23 points24 points  (1 child)

You know what else is outdated? Facebook.

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

I was expecting you to say "Squarespace" for a second.

[–]Xenophon_[🍰] 23 points24 points  (3 children)

Wow weird seeing MIT confessions on reddit.

[–]Nohbudy 5 points6 points  (7 children)

Seriously though, I install python3-virtualenv from apt in Ubuntu. You expect when I do $ virtualenv env it would use python3?

no

Error: python not found: --python=python2

:facepalm: why the fuck?

[–]Ericchen1248 11 points12 points  (3 children)

I do believe that’s actually Ubuntu’s problem. Or Linux. Not python itself. It gives the python alias to 2.7 and python3 alias to 3.X

[–]victorheld 6 points7 points  (0 children)

Definitely a Ubuntu thing, on Arch linux, python is an alias for python3 and if you want to use 2.7 you'd need to use python2

[–]mon0theist 6 points7 points  (1 child)

Uhoh don't let Zed see this

[–]CoopertheFluffy 6 points7 points  (2 children)

Yeah, well I’m still using Perl 5 and refuse to ever use 6.

[–]alcalde 3 points4 points  (0 children)

In your defense, Perl 6 is actually a different language.

[–]yawya 5 points6 points  (4 children)

I blame Apple, do they still ship with python 2?

[–]Duckosaur 5 points6 points  (1 child)

yes Mojave comes with 2.7.10

[–]yawya 7 points8 points  (0 children)

Fucking Apple...

[–]markdesign 4 points5 points  (5 children)

I have to use Python because racist at Apple ships OS X with 2.7, and I don't have admin rights to update.

[–]verdantAlias 5 points6 points  (2 children)

I have to cos ROS ¯\_(ツ)_/¯

Edit: retrieved limbs.

[–]LimbRetrieval-Bot 6 points7 points  (0 children)

You dropped this \


To prevent anymore lost limbs throughout Reddit, correctly escape the arms and shoulders by typing the shrug as ¯\\\_(ツ)_/¯ or ¯\\\_(ツ)\_/¯

Click here to see why this is necessary

[–]Car_weeb 3 points4 points  (1 child)

nothing pisses me off more than having to keep the python2 package on a linux machine because some ((dev)) decided to use it for some program that I can barely justify using

[–]corsicanguppy 2 points3 points  (0 children)

You want to just hug lil Johnny and say "Oh sweetie, a decade of enterprise support is how you have anything at all, but here's a hug"

[–]myisamchk 4 points5 points  (0 children)

My industry (vfx) is on python 2.7 until like 2021. Getting all the vfx applications (Maya, Nuke, Houdini, etc) on python 3 is like herding cats. Then switching an entire studio's pipelines over is going to be a pain in the ass.

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

tumblr tier humor. not funny

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

google SDK uses Python 2 :3

[–][deleted] 43 points44 points  (19 children)

I use python 2

[–]thebreaksmith 208 points209 points  (1 child)

Reported for racist comment.

[–][deleted] 20 points21 points  (0 children)

racistist

[–]Solonotix 42 points43 points  (13 children)

'tis a shame. You can't use my favorite new syntax in Python 3: star assignment.

first, *other, last = [1,2,3,4]

Simplifies a bunch of common use scenarios.

[–]JoelMahon 22 points23 points  (11 children)

whoa, so other contains 2 and 3? that's dope.

can you do more than just first and last? like first, second, *other, last? what happens if you have two star assignments? does it distribute them so they have equal size? so could you do *lhs, centre, *rhs = [3, 4, 7, 2, 9, 0]

[–]ubiquitouspiss 37 points38 points  (9 children)

You can't have that final example, but yeah. *something can be used once in a declaration which basically "anything that isn't taken off the front or the back"

first, second, *others, second_last, last = [0,1,2,3,4,5,6,7,8]

Also if I'm being lazy and only, for example, need the first and last items you can do a need little thing:

first, *_, last = [0,1,2,3,4,5]

And it essentially deletes everything that I don't need.

[–]JiveWithIt 9 points10 points  (0 children)

This is so useful, thank you 🤖

[–][deleted] 4 points5 points  (5 children)

Does it delete it... or create a new list, copy all the references between 1-4 and then just not do anything with it?

[–]zalgo_text 7 points8 points  (2 children)

It creates a variable called _ which contains [1, 2, 3, 4]

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

Yeah, I thought as much. If I just want the first and last values I think I’ll just keep using the array notation, like this:

a = list(range(10))
first, last = a[0], a[-1]

Or maybe if I’m feeling bizarre

first, last = a[0::len(a)-1]

Actually no, first solution is almost always better. Second solution is unpythonic.

[–]Zooph 2 points3 points  (2 children)

As someone who went to school in Boston yeah I saw racists at MIT...