Python’s help() global function, when run, freezes the shell completely.
Steps to reproduce:
Create a Python Repl.
Run python in the shell.
For variables with longer “help” content (e.g. int), press Enter continuously for a quick while.
Try pressing Ctrl + C to raise a KeyboardInterrupt and fail miserably.
Step 5 should have stopped IDLE from continue running, and the last Enter should have switched the help interactive interface to the normal IDLE.
No amount of keypressing/clicking help. Not even the clear button.
Reloading the tab, however, fixes the problem. Ctrl + Z also works; a possible explanation for that is found in this 2015 StackOverflow comment.
No, this is probably not a bug. The help() function invokes pydoc, which generates the documentation you see. Pydoc itself may use less, which is for file navigation (so you can search and stuff).
For commands and stuff, see: https://man7.org/linux/man-pages/man1/less.1.html
The help() commands open up a linux program called less, for file navigation. This program is not related to python and happens to ignore keyboard interrupts (it doesn’t have any CTRL commands).
When it reaches the end of the file, it does not exit (it does say “END” to indicate the end of the file). Why? It’s supposed to be a file navigation program. You wouldn’t want to automatically exit the file when you’re trying to search stuff or read stuff. You just exit when you want to, with q.