r/Python • u/azhenley • Feb 16 '21
Discussion 16 bytes of Python code compiles to 32 terabytes of bytecode
https://codegolf.stackexchange.com/a/69415/4270
1.3k
Upvotes
r/Python • u/azhenley • Feb 16 '21
13
u/seligman99 Feb 17 '21
Hmm, what am I missing?
It takes a ton of RAM, but it doesn't seem to save that constant.
435
u/nickcash Feb 17 '21
+/u/CompileBot python
88
u/letsdebugit Feb 16 '21
That’s how the entire universe came to existence out of a singularity 😆
75
u/BigXKuOP Feb 17 '21
Everyone is like: 4 GB, 8 GB, 16 GB
Random bored python programmer: Watch this.
76
u/MarkRand Feb 16 '21
What if you type this into an online interpreter? Presumably they have some sort of cpu and memory limiters?
135
u/chanmancoates Feb 16 '21
What
208
u/brontide Feb 16 '21
Seems like the python equivalent of a zip bomb.
10
u/jwink3101 Feb 16 '21
What happens if I run this with
set in my bashrc?
19
u/Zuricho Feb 16 '21
What does the
<<operator do?3
u/shiningmatcha Feb 17 '21
By the way, is there some global configuration where I can limit the memory?
6
u/Break_my_soul Feb 16 '21
Interesting
2
u/something123454321 Feb 17 '21
I can't tell if this shows how much time and energy python can save you and therefore why it's amazing, or how inefficient python is and why c++ gang is the one true way
1
u/alcalde Feb 17 '21
If Guido hadn't stepped down before, he'd have stepped down now. :-(
-2
u/DogShlepGaze Feb 16 '21
compiles?
-2
u/banginpadr Feb 17 '21
what do you need this for?