5 ms·
The Python interactive shell could check the user's input: If it'll take infinitely long to run (e.g., an infinite generator), then it'll halt. If the code wil
by reuven 13y ago
The Python interactive shell could check the user's input: If it'll take infinitely long to run (e.g., an infinite generator), then it'll halt. If the code will eventually return, then it'll be run, displaying results to the user. Seems simple enough, no?
- hyperpape 13y agoYou'll need some killer heurstics: https://en.wikipedia.org/wiki/Halting_Problem https://en.wikipedia.org/wiki/Halting_Problem
- reuven 13y agoEr, I sorta knew that I was describing the halting problem, and was wondering if someone would fail to realize my sarcasm...
- hyperpape 13y agoYeah, I see that "should be easy enough" at the end. My bad.
- sitkack 13y agoThat is all programs in general, checking a specific program is totally within bounds.