[docs] [issue9362] Make exit/quit hint more novice friendly

Ron Adam report at bugs.python.org
Sat Jul 24 07:45:35 CEST 2010

Ron Adam <ron_adam at users.sourceforge.net> added the comment:

I agree it could be improved a bit.

A little experimenting comes up with the following inconsistencies.

>>> quit
Use quit() or Ctrl-D (i.e. EOF) to exit
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit

help(exit) and help(quit) is not helpful. It instead shows the Quitter class in site.py with no doc strings.

exit() and quit() are both equivalent to sys.exit() and both except an exit code or message.

I think your third choice is good.

Type exit() or quit() and press Enter to exit

Advance users can still use Cntl-D.

Add a topics entry for help('EXIT') which can explain exiting the console in more detail and include the Ctrl-D short cut. help('QUIT') can point to the same topics info used for 'EXIT'.

Then add a doc string the the Quitter class that says to use help('EXIT') or help('QUIT') to get help for exit and quit.  

On another note: I've sometimes wanted quit() to exit from a running script to the python console so I can do a little value checking.  And for exit() to exit both the program and the console. But I think it may be too lake to make that particular change.

nosy: +ron_adam

Python tracker <report at bugs.python.org>

More information about the docs mailing list