comex 1 day ago

Specifically, there are two loops, one nested inside the other, and the total number of iterations is 1 billion.

I was hoping this would test how long it takes to compile 1 billion nested loops. As in, a 2-billion-line source file where the first billion lines each open a loop and the next billion lines close them all. That would be… interesting. Pointless, but interesting.

1
UltraSane 1 day ago

I would expect that would break the Python interpreter. Hmm. Now you have me wanting to try it. Writing Python that writes Python is always fun.

andreareina 1 day ago

The indentation alone would be half an exabyte. You could transform it into an equivalent representation with a billion-variable list (or numpy array) that should fit within the limits of the interpreter.