Re: Why does IDLE use a subprocess?
James Schaffler via IDLE-dev <[email protected]> Sun, 04 Jun 2023 01:41:17 +0000
| Newsgroups | gmane.comp.python.idle |
|---|---|
| Message-ID | <Q0OoDJxk7PcnYP2hjPclOKRbi4HvaO7hPj9fouF2ZBtxwHCRaCreQZQWdPn_qbFJ6B-PiiIKcMoPNgrokEfinbkqfQpINwSDbI2rBdUoAT8=@proton.me> |
On Thursday, June 1st, 2023 at 2:37 PM, Tal Einat wrote: > IDLE's use of a sub-process is not primarily about security. > > If one were to run user code within the same Python process (as IDLE originally did!), then the Python interpreter would be shared between the user code and IDLE. > > (It is today possible to run a (nearly entirely) separate Python interpreter within the same process, but that is a relatively new development from recent years.) > > Sharing the interpreter is a problem for various reasons, led by: > * User code can break IDLE in many interesting and unexpected ways. > * User code can block the main thread, which would make IDLE unresponsive. > > There are many other reasons too. For example, the "restart interpreter" feature is much harder, perhaps impossible, to implement. > > Let me know if you'd like any further details. > - Tal Einat Hi Tal, This is a great answer, thank you so much! I didn't consider that blocking the main thread could be a problem. However, I would be interested to see in what additional "interesting and unexpected ways" one could break IDLE. Thank you, Jim