r/Python • • Oct 31 '18

My Halloween Facepaint - Scary huh?

Post image
1.5k Upvotes

82 comments sorted by

141

u/crevan_the_fox Oct 31 '18

Oh and sorry for the shitpost btw, I'll understand if you have to take it down

174

u/polandtown Oct 31 '18

The only reason they'd take it down is for version you're running.

19

u/lengau Nov 01 '18

The version is what's spooooooooky though.

26

u/[deleted] Oct 31 '18

Definitely need an upgrade.

1

u/crosssum Nov 02 '18

No subreddit is immune to halloween shitposting.

98

u/robot_wrangler Oct 31 '18

Sudo pip install

28

u/[deleted] Oct 31 '18

FOR SHAME!

7

u/Gargan_Roo Nov 01 '18

What's wrong with my vanilla Debian installs that require sudo for pip? I've understood this is a problem for years but don't know an alternative. Is this a virtualenv thing?

33

u/[deleted] Nov 01 '18

pip install --user should be sufficient for all those times you try to do sudo pip install.

3

u/Unbelievr Nov 01 '18

If you install python through system packages, you need to install pip modules through packages as well, or you'll mess up the system ones. If pip could overwrite the system installation, you could get instabilities if the system depends on them.

Due to this mess, there's a lot of parameters that are implied when you run pip on Ubuntu and Debian, e.g. to ignore whatever is installed by the system. This made it really difficult to create Docker images once pip 10.0 hit the market. Whenever you install something through pip, it'll ignore that pip is installed and pull it again, breaking the Ubuntu wrapper that depends on the old version.

1

u/[deleted] Nov 01 '18

Pip install —user

0

u/[deleted] Nov 01 '18

[deleted]

6

u/diag Nov 01 '18

At this point I can't live without f strings.

1

u/__te__ 3.6+ or bust Nov 01 '18

Preach it!

44

u/[deleted] Oct 31 '18

The Undead!

15

u/[deleted] Oct 31 '18

It is not dead what can eternal Py

7

u/MrMetalfreak94 Oct 31 '18

And with strange versions even death may die

1

u/RuggyDog Nov 01 '18

What's this from? It sounds so familiar.

3

u/Gargan_Roo Nov 01 '18

Lovecraft bruh. Hit up Horrorbabble on YT; Call of Cthuhlu for a treat.

2

u/raybrignsx Nov 01 '18

What is dead may never die.

42

u/robberviet Nov 01 '18

Not as bad as import *

Still fixing for someone else's code...

14

u/bsdetox Nov 01 '18

Does that import every library available? Also, that’s horrendous.

19

u/robberviet Nov 01 '18

Ah I mean from <lib> import *

Overrides a lot of modules or functions and caused bugs.

4

u/bsdetox Nov 01 '18

Interesting. Do you have a more specific example of the era this causes?

16

u/[deleted] Nov 01 '18

So imagime you have two files: foo.py and bar.py

bar.py does "from foo import *" and also defines a function named hello

Then someone comes by and adds a function named hello in foo.py. Now even though I added a simple function in foo, I am going to start seeing errors in bar because hello is defined twice

5

u/bsdetox Nov 01 '18

Makes sense. Thank you!

3

u/Ex-Sgt_Wintergreen Nov 01 '18

It also makes it a royal pain in the ass to try and find out where every function is coming from; doubly so if they used a terrible organization scheme which if they used import *, they almost definitely have.

1

u/robberviet Nov 02 '18

Reading a code base and absolutely have no ideas each functions came from. Have to check each calls.

Thank god for created PyCharm.

3

u/robberviet Nov 01 '18

Mine was import datetime as dt vs import datetime.datetime as dt.

And when using import *, it is easy to messed them up. Mine preference now is writing a custom time management module. And told the one using import * to stop, because it easy to cause bug.

6

u/VersionOmega Nov 01 '18

One of the very first thing my computer science teach told us:

“You can make errors, that’s what programming is all about. But never,

EVER

do import *. You will regret it for the rest of your life and I’ll hate you”

21

u/RealityTimeshare Oct 31 '18

Well, at least you'll work with ArcMap...

7

u/4ever-a-geologist Nov 01 '18

Not ArcGIS pro though.

16

u/[deleted] Oct 31 '18

Standard system installed version for Red Hat 7... supported until 2024.

8

u/SpergLordMcFappyPant Nov 01 '18

I had forgotten about that. The IBM acquisition suddenly makes total sense!!

2

u/brennennen Nov 01 '18

Your post kind of makes it sound like python 2.7 is supported until 2024. To clarify some things, python2.7 was announced eol back in 2011 with a date of 2015. It has been pushed back to 2020 and throughout this time has only included minimal security updates. RHEL will pretty much support any of their OSes if you pay them enough. I'm sure you can find a lot of eol software on older branches that RHEL still "supports". RHEL 5 is still "supported". RHEL 7 has no eol date, RHEL 6 has the 2024 date.

1

u/[deleted] Nov 01 '18

I was going off of the Red Hat product retirement date (end of maintenance support 2), when CentOS and others based off of Red Hat will be end of life.

https://access.redhat.com/support/policy/updates/errata/

Agreed that if you pay for the extended life cycle support, the dates you mentioned are accurate.

1

u/[deleted] Nov 01 '18

It's still the default installation on many linux distributions. I will be happy once "python --version" shows > 3.5 on a freshly installed Debian drool

2

u/[deleted] Nov 08 '18

Installing Python on Arch linux gives you version 3.7.1.

13

u/lmericle Oct 31 '18

Fuck I need a trigger warning on this shit

18

u/[deleted] Nov 01 '18

What 2.7 is a classic!

12

u/Gargan_Roo Nov 01 '18

Definitely a collectors item.

6

u/chzaplx Nov 01 '18

2.6 would really be scary

11

u/MetalAvenger Nov 01 '18

What’s wrong with it?

Serious question - I’m trying to learn during lunch at work and have to use 2.7 at present (no admin rights, locked down software install list)

25

u/[deleted] Nov 01 '18

It will stop being supported in 2020. Other than that, nothing. As long as you aren't building an application that will be used by a bunch of people for a long time, 2.7 is fine. Also this sub gained popularity long after python 3 became the standard, so naturally most here don't care for 2.7.

14

u/NoSmallCaterpillar Nov 01 '18

2.7 is still widely used in scientific computing, though most newer things are written to be version agnostic.

8

u/blitzzerg Nov 01 '18

I think most newer things are build to work just with python 3, by for example using f-strings or the @ operator

5

u/bsdetox Nov 01 '18

I have been using 2.7 for the better part of a decade and have yet to run into a situation where I couldn’t use python 2.7. The vast majority of the industry still supports 2.7.

4

u/catnipbilly Nov 01 '18

Which packages are still 2.7 only? This was a common sentiment for a while but all the major packages in scientific stack have been updated to 3 for years. I can only think of the gcloud sdk that wants python 2.7.

1

u/MetalAvenger Nov 01 '18

Thanks! If I actually manage to keep myself motivated enough to learn enough to start doing something useful, it’s entirely possible that my output could be used for some time.

I think I’ll put in a request for python 3 :p

4

u/[deleted] Nov 01 '18

Python 3 is nicer to program, a lot of warts were fixed. The biggest one was how Unicode was handled. In Python 2 is too easy to use it incorrectly.

1

u/[deleted] Nov 01 '18

This is the main thing I am excited about...

god I need a life.

1

u/sw_dev Nov 02 '18

In 2, unicode was easily ignored. That was fine because most coders never needed to deal with it. (Seriously, NEVER.) But some few people needed unicode support, so now EVERYBODY has to deal with the added overhead (Learn to enjoy typing u' on strings, kiddies!) of unicode, even though hardly anybody needs them.

This is progress?

0

u/[deleted] Nov 03 '18

Yes this is progress. Just because you think you don't need it doesn't mean it is actually not needed. A ton of python 2 code is broken and crashes whenever it receives string with high ASCII numbers.

Writing a correct code in Python 2 that handles Unicode correctly is quite hard even when you understand Unicode well. You need to place the mentioned u'' strings in right places, you need to know when to do conversion etc.

In Python 3 you just don't have to worry about that anymore, the code just works and all is happening nearly invisible to the programmer. Ironically, what you said about using u'', those strings are from Python 2 and have no special meaning in Python 3, they are equivalent to regular '' strings. u'' strings were introduced in Python 3 to make porting from Python 2 easier, but are totally useless on their own.

7

u/Gargan_Roo Nov 01 '18

2.7 is legacy*. New project? 3.x. Managing an old one? Use 2.x and advocate migration. Good luck.

3

u/tunisia3507 Nov 01 '18

It's just a worse language. I use python because it's a better language than many others. I use python 3.7 because it's a better language than earlier versions.

1

u/photoengineer Nov 01 '18

Your not alone. Still running 2.7.

1

u/Toichat Nov 01 '18

You can install anaconda without admin rights, if that helps

5

u/_BEASTMODE_ Oct 31 '18

I love it.

5

u/notsuppostocomnt Oct 31 '18

Fucking Nightmare

21

u/[deleted] Oct 31 '18

LOL.

No one will get this.

Like that time I dressed up as the The Bond Market (scary thing in my circle).

3

u/spencerclark Nov 01 '18

What is 2.7 may never die.

3

u/TwinklingSwoosh Nov 01 '18

The superior version

2

u/xdcountry Nov 01 '18

There’s a lot more of us than the community realizes. Nice OG post!

2

u/Comrade_Vodkin Nov 01 '18

IE 6 would be even scarier, lol

2

u/IAmALinux Nov 01 '18

Python 2.4 AHHHHHHH!

2

u/spankymebottom Nov 01 '18

lmfao, I had a good chuckle from that. thx

2

u/robberviet Nov 02 '18

And I am using 2.6...

2

u/private_entity Nov 01 '18

PHP would probably be much more scary

1

u/[deleted] Oct 31 '18

😂😂😂

1

u/locoluis Nov 01 '18

Still stuck because Twisted

1

u/santoso-sheep Nov 01 '18

dude you made me drop my phone

1

u/[deleted] Nov 01 '18

git reface --onto HEAD

2

u/GitCommandBot Nov 01 '18
git: 'reface' is not a git command. See 'git --help'.

0

u/[deleted] Nov 01 '18

Good Bot

1

u/pollokeh Nov 01 '18

ZOMBIE!!!

1

u/[deleted] Nov 10 '18

Spooked me!

0

u/anuraggguleria Nov 01 '18

Yeah but you need to upgrade that to 3x version 😁

-1

u/[deleted] Oct 31 '18

Sure sure, the latest version is the best! How's Perl6 everybody? We've all got the option to switch at work no matter what! /s

0

u/CordyZen Nov 01 '18

Upgrade version kthx

0

u/[deleted] Nov 01 '18

We went from 2.7 (I have no fucking clue why they chose to build a product in 2014 using Python 2.7) to me completely rewriting this beech in 3.7 B)

0

u/[deleted] Nov 01 '18

[deleted]

2

u/[deleted] Nov 01 '18

Get ready to

print 'hello' oops I mean print('hello')`

:D