|
|
|
|
|
by gruez
901 days ago
|
|
> It should print the first to stdout and the second to stderr. That's completely consistent with how stdout and stderr are usually used. That makes sense from a unix tool perspective, but not from a python repl perspective. The repl's behavior is to print the result from the last executed statement. For the exit function, the __repr__ method was overwriten to print the message. That way when you type in "exit", the last value would be exit (the function), and the overwritten __repr__ method causes the help message to be printed. There's no way to have it print to both without adding in some repl specific hacks. >>> exit
Use exit() or Ctrl-Z plus Return to exit
>>> exit.__repr__()
'Use exit() or Ctrl-Z plus Return to exit'
|
|