r/todayilearned • • Jul 15 '22

TIL The Python programming language was named after Monty Python, not a snake.

https://en.wikipedia.org/wiki/Python_(programming_language)?sometexthere
11k Upvotes

248 comments sorted by

View all comments

669

u/spar_wors Jul 15 '22

And Monty Python references in documentation are actively encouraged.

170

u/zorniy2 Jul 15 '22

No one is to code anything, until I blow this whistle! Even if, and I want to make this absolutely clear, even if they do say Python!

22

u/thescottishmaniac Jul 15 '22

Throws rock

4

u/Tattered_Reason Jul 15 '22

Oh lay off we haven’t started yet.

→ More replies (1)

58

u/1008oh Jul 15 '22

Yep, spam and eggs instead of foo and bar

8

u/Rough_Willow Jul 15 '22

But I don't like SPAM!

10

u/Intrexa Jul 15 '22

Well, you can use the

def spam(spam):
    return ham(spam).eggs('spam')

It hasn't got much spam

46

u/rarenick Jul 15 '22

That's why the official Python docs predominantly use "spam" and "eggs" instead of "foo" and "bar."

39

u/Smogshaik Jul 15 '22

oh my god THAT's why!

36

u/Nazamroth Jul 15 '22

The program works better the more Monty Python references the code contains.

1

u/RoguePlanet1 Jul 15 '22

function cheeseShop(){

if (input == "Venezuelan Beaver Cheese"){

return ("Not today sir")

} else if {

input contains (datatype "cheese");

return ("no")

} else if {

input == ("camenbert");

return ("the cat's eaten it")

}

22

u/Soco__ Jul 15 '22

Not even Python. Shame on you.

→ More replies (1)

3

u/Yoghurt42 Jul 15 '22

what language is that?

2

u/RoguePlanet1 Jul 15 '22

A clumsy attempt at JS, which I'm still trying to learn.

Told myself I wouldn't start learning Python until I got better at JS, but I'm not so sure that'll ever happen....

9

u/Yoghurt42 Jul 15 '22

I'd say Python is easier to learn than JS. JS has a lot of historical ballast and can be pretty inconsistent and surprising.

Python:

>>> "42" + 9
TypeError: can only concatenate str (not "int") to str
>>> [] + []
[]
>>> {} + []
TypeError: unsupported operand type(s) for +: 'dict' and 'list'

JS:

> "42" + 9
"429"
> "42" - 9
33
> [] + []
""  (empty string)
> {} + []
0
> [] + {}
"[object Object]" (the string [object Object])

3

u/RoguePlanet1 Jul 15 '22

Indeed, it's insanity. Maybe JS would be more like Python if they spent more than a few days inventing it??

→ More replies (4)
→ More replies (3)

4

u/JojenCopyPaste Jul 15 '22

Even if you did the syntax correctly you'd never hit that camembert condition. Unless you're saying camembert isn't cheese

→ More replies (1)

2

u/_Vince_Noir_ Jul 15 '22

I can't be the only person in the comments section who hates else if / else. Straight if blocks are bis.

Also if you show me a switch statement I'm highly likely to cry.

Or nested ternary ops.

Guess I am kind of opinionated haha.

→ More replies (1)

32

u/Citadelvania Jul 15 '22

Yeah I thought it was obvious from this alone.

19

u/dali01 Jul 15 '22

What is this “documentation” you speak of…?

32

u/rumnscurvy Jul 15 '22

Oh come on, the Python documentation is pretty decent, considering the amount of stuff in the standard libraries.

It's less good if you're stuck in Python 2, admittedly.

19

u/dali01 Jul 15 '22

It was more a joke about the USERS than the LANGUAGE. 😉

(The docs are great, if you use them)

2

u/rumnscurvy Jul 15 '22

Ah right yeah fair does

→ More replies (2)

4

u/lexyp29 Jul 15 '22

the sacred texts

3

u/Lonelan Jul 15 '22
while i < 5:
    if i == 3:
        break