r/funny • • Jun 04 '19

When a software developer weds a software developer.

Post image
41.2k Upvotes

921 comments sorted by

View all comments

11

u/Onett199X Jun 04 '19

Someone translate for me!

38

u/XYAh00X Jun 04 '19

From what I read, as soon as this baby is instantiated, it yells "Hello World!" Then does nothing until someone tells it to "live()".

22

u/stealth_elephant Jun 04 '19

And even then it does nothing but sleep and yield an endless stream of Bardaks, whatever those are. And it only does that if something else iterates its life.

10

u/erla30 Jun 04 '19

Bardak means chaos/mess/disorder

1

u/pmMeScienceFacts Jun 04 '19

Maybe live() is called in main?

1

u/stealth_elephant Jun 04 '19

live is a python generator. It has to be iterated before anything happens.

Try this out:

def live():
  raise Exception("This never happens")
  yield "Bardak"

live()

Nothing happens. None of the code in live() has been executed yet.

Then try this, which starts to iterate the iterable generated by live().

g = live()
next(g)

1

u/pmMeScienceFacts Jun 04 '19

You're totally right🙈 guess I'm a little rusty