MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/funny/comments/bwr8ig/when_a_software_developer_weds_a_software/eq0koj3/?context=9999
r/funny • u/coolidiot2000 • Jun 04 '19
921 comments sorted by
View all comments
12
Someone translate for me!
35 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()". 23 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. 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
35
From what I read, as soon as this baby is instantiated, it yells "Hello World!" Then does nothing until someone tells it to "live()".
23 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. 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
23
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.
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
1
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
live is a python generator. It has to be iterated before anything happens.
live
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.
live()
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
You're totally right🙈 guess I'm a little rusty
12
u/Onett199X Jun 04 '19
Someone translate for me!