First example seems odd? The author acknowledges that the two proposed alternatives (printing "<function exit>" or actually exiting) aren't great. The fact that the Python REPL provides a helpful hint seems like extra effort to make your life easier. This is especially notable given that in the next example, the author's complaint is about a command _not_ providing special guidance about the thing the user is probably trying to do.
dale_glass|2 years ago
bvisness|2 years ago
dmurray|2 years ago
The regular Python REPL doesn't distinguish between stdout and stderr (perhaps it should!), but you can embed it in things like Jupyter notebooks that do.
ssgodderidge|2 years ago
… or a long-time dev that switches languages fairly often :)
IshKebab|2 years ago
I think telnet does something stupid along the same lines "I know you want to quit but please ask address me as Sir first".
pluc|2 years ago
When you work with _precise_ systems, they sometime take _precise_ input to work. That's kinda just part of the job.
phs318u|2 years ago
imron|2 years ago
We saw this play it with web browsers in the late 90s early ‘aughts where they’d do their best to render what they thought you meant if your html was wrong, and it was indeed chaos.
Strict systems with strict inputs makes for a better overall ecosystem.
devjam|2 years ago
I agree; Python is actually helping you out here, since just typing `exit` doesn't actually call the callable.
Also, Python being Python, while not recommended, there's nothing stopping the user from assigning to `exit` then printing it in the repl:
What would the author expect Python to do in this instance?MichaelDickens|2 years ago
nneonneo|2 years ago
gizmo|2 years ago
andy99|2 years ago