On Sat, Feb 02, 2019 at 03:37:36PM +1100, Steven D'Aprano <st...@pearwood.info> wrote: > Sorry, I was not as clear as I ought to have been: > > On Sat, Feb 02, 2019 at 02:10:06PM +1100, Steven D'Aprano wrote: > > > > * Clear separation (using, for example, different colors) > > > between input, output and errors; > > > > Input always starts with a prompt; exception tracebacks always start > > with the line "Traceback..."; other errors are generally not > > programmatically distinguishable from non-errors. > > By which I mean, if a script or module reports an error by just printing > a message to the screen: > > print("sorry, an error occurred") > > sort of thing. Obviously the interpreter cannot guess which messages > represent errors in that sense and which are non-error output. > > (Of course, a script could format its own error messages, say by using > terminal-specific colour codes.)
Scripts that report errors this way are broken and must be fixed: print("sorry, an error occurred", file=sys.stderr) Now it's easy to separate normal output from errors and colorize them differently. > -- > Steve Oleg. -- Oleg Broytman https://phdru.name/ p...@phdru.name Programmers don't die, they just GOSUB without RETURN. _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/