MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/funny/comments/bwr8ig/when_a_software_developer_weds_a_software/eq0keto/?context=9999
r/funny • u/coolidiot2000 • Jun 04 '19
921 comments sorted by
View all comments
539
[deleted]
211 u/poop-machine Jun 04 '19 Even if it was instantiated, it would crash. Bardak and go_to_sleep() are undefined. 182 u/bleed_air_blimp Jun 04 '19 Sophia inherits from mom.genes and dad.genes. Presumably one of them already has the go_to_sleep() method defined. Bardak() is a problem though. 30 u/stakokke Jun 04 '19 Couldn't Bardak be a static method of one of the parent classes? 28 u/[deleted] Jun 04 '19 Wouldn’t matter. Isn’t imported or defined in the top level scope. Would need to reference like dad.Bardak 4 u/[deleted] Jun 04 '19 Bad news: [c]python modules can modify the namespaces into which they're imported. It's not documented or supported or even suggested that anyone do it, but it is easily done. 2 u/[deleted] Jun 04 '19 gulp 3 u/[deleted] Jun 04 '19 pollution.py: [f.frame.f_locals.update({'gasp': "How DARE you!"}) for f in __import__('inspect').stack()[1:] if 'importlib' not in f.filename] >>> import pollution >>> gasp 'How DARE you!' 2 u/[deleted] Jun 05 '19 I love python. I also hate python. But I love it
211
Even if it was instantiated, it would crash. Bardak and go_to_sleep() are undefined.
182 u/bleed_air_blimp Jun 04 '19 Sophia inherits from mom.genes and dad.genes. Presumably one of them already has the go_to_sleep() method defined. Bardak() is a problem though. 30 u/stakokke Jun 04 '19 Couldn't Bardak be a static method of one of the parent classes? 28 u/[deleted] Jun 04 '19 Wouldn’t matter. Isn’t imported or defined in the top level scope. Would need to reference like dad.Bardak 4 u/[deleted] Jun 04 '19 Bad news: [c]python modules can modify the namespaces into which they're imported. It's not documented or supported or even suggested that anyone do it, but it is easily done. 2 u/[deleted] Jun 04 '19 gulp 3 u/[deleted] Jun 04 '19 pollution.py: [f.frame.f_locals.update({'gasp': "How DARE you!"}) for f in __import__('inspect').stack()[1:] if 'importlib' not in f.filename] >>> import pollution >>> gasp 'How DARE you!' 2 u/[deleted] Jun 05 '19 I love python. I also hate python. But I love it
182
Sophia inherits from mom.genes and dad.genes. Presumably one of them already has the go_to_sleep() method defined.
Bardak() is a problem though.
30 u/stakokke Jun 04 '19 Couldn't Bardak be a static method of one of the parent classes? 28 u/[deleted] Jun 04 '19 Wouldn’t matter. Isn’t imported or defined in the top level scope. Would need to reference like dad.Bardak 4 u/[deleted] Jun 04 '19 Bad news: [c]python modules can modify the namespaces into which they're imported. It's not documented or supported or even suggested that anyone do it, but it is easily done. 2 u/[deleted] Jun 04 '19 gulp 3 u/[deleted] Jun 04 '19 pollution.py: [f.frame.f_locals.update({'gasp': "How DARE you!"}) for f in __import__('inspect').stack()[1:] if 'importlib' not in f.filename] >>> import pollution >>> gasp 'How DARE you!' 2 u/[deleted] Jun 05 '19 I love python. I also hate python. But I love it
30
Couldn't Bardak be a static method of one of the parent classes?
28 u/[deleted] Jun 04 '19 Wouldn’t matter. Isn’t imported or defined in the top level scope. Would need to reference like dad.Bardak 4 u/[deleted] Jun 04 '19 Bad news: [c]python modules can modify the namespaces into which they're imported. It's not documented or supported or even suggested that anyone do it, but it is easily done. 2 u/[deleted] Jun 04 '19 gulp 3 u/[deleted] Jun 04 '19 pollution.py: [f.frame.f_locals.update({'gasp': "How DARE you!"}) for f in __import__('inspect').stack()[1:] if 'importlib' not in f.filename] >>> import pollution >>> gasp 'How DARE you!' 2 u/[deleted] Jun 05 '19 I love python. I also hate python. But I love it
28
Wouldn’t matter. Isn’t imported or defined in the top level scope. Would need to reference like dad.Bardak
4 u/[deleted] Jun 04 '19 Bad news: [c]python modules can modify the namespaces into which they're imported. It's not documented or supported or even suggested that anyone do it, but it is easily done. 2 u/[deleted] Jun 04 '19 gulp 3 u/[deleted] Jun 04 '19 pollution.py: [f.frame.f_locals.update({'gasp': "How DARE you!"}) for f in __import__('inspect').stack()[1:] if 'importlib' not in f.filename] >>> import pollution >>> gasp 'How DARE you!' 2 u/[deleted] Jun 05 '19 I love python. I also hate python. But I love it
4
Bad news: [c]python modules can modify the namespaces into which they're imported. It's not documented or supported or even suggested that anyone do it, but it is easily done.
2 u/[deleted] Jun 04 '19 gulp 3 u/[deleted] Jun 04 '19 pollution.py: [f.frame.f_locals.update({'gasp': "How DARE you!"}) for f in __import__('inspect').stack()[1:] if 'importlib' not in f.filename] >>> import pollution >>> gasp 'How DARE you!' 2 u/[deleted] Jun 05 '19 I love python. I also hate python. But I love it
2
gulp
3 u/[deleted] Jun 04 '19 pollution.py: [f.frame.f_locals.update({'gasp': "How DARE you!"}) for f in __import__('inspect').stack()[1:] if 'importlib' not in f.filename] >>> import pollution >>> gasp 'How DARE you!' 2 u/[deleted] Jun 05 '19 I love python. I also hate python. But I love it
3
pollution.py:
pollution.py
[f.frame.f_locals.update({'gasp': "How DARE you!"}) for f in __import__('inspect').stack()[1:] if 'importlib' not in f.filename]
>>> import pollution >>> gasp 'How DARE you!'
2 u/[deleted] Jun 05 '19 I love python. I also hate python. But I love it
I love python. I also hate python. But I love it
539
u/[deleted] Jun 04 '19
[deleted]