Currently if the Qt input hook runs and there is not as exiting QApplication IPython will create one for the user and then spin it. On one hand this is convenient for doing Qt work as the Application is automatically created after the first cell runs. However, this can lead to weird behavior where running commands in one line vs serval cells leads to different results (see DeepLabCut/DeepLabCut#1730).
Although I advocated for the current state of affairs, I now think that it is more confusing this way. I propose that basically this entire block of code is removed and replaced with return
Activity
tacaswell commented on Apr 30, 2022
https://gist.github.com/pag/f7d1ebbd1b14fe9058bf68d73a52bc84 is a patch that implements this a related idea that does not spin the event loop until it is needed.