Re:You can't do that because I hate you
by bvisness on Thursday December 28, 2023 @07:00PM
(#38800257)
Yes, I completely agree. If you want to teach the user the rules, then you follow the rules. The problem with the Python example is that they DID special-case it, but in an unhelpful way.
[ Parent
| on HN ]
How is it unhelpful? It literally tells what to do.
Is it too hard to write exit() or press Ctrl+D after having incorrectly entered exit?
The special case is actually less a special case than you'd expect. It's "just" a python object that does some slightly funky things when turned into a string[0]. Making plain `exit` actually exit would mean triggering it accidentally could get too easy or would need a special case in the interpreter itself.
[0] https://github.com/Source-Python-Dev-Team/Source.Python/blob...