3 ms·
Where the article suggests it should be like: >>> help Type help() for interactive help [..]. This sort of (dis)functionality really gets on my nerves. Wh
by jodrellblank 18y ago
Where the article suggests it should be like:
>>> help
Type help() for interactive help [..].
This sort of (dis)functionality really gets on my nerves. Whenever I hit a 'nix program that does this:
$somecmd -h
Error. Use --help for help.
$somecmd --help
{help text}
or, in MacOS when I press CMD-C in the terminal instead of CTRL-C and it just beeps at me, but does nothing...
Why don't you Just DWIM? Grr.
- shadytrees 18y agoAs it stands, help is a string. If help does what you suggest, it becomes a keyword. Then it has to go into the parser. Then somebody has to maintain that code. And document it. And the backend code gets larger. If it doesn't become a keyword, it becomes an exception to the rule. Which means you'll have to deal with edge cases where the user tries to fudge with the value of `help`. Does it act like a keyword? Should it have different semantics? Should there be a separate category for it? And then: What about `quit`? And `exit`? The problem with DWIM is that doing what you mean in one case can create doing-what-you-don't-mean in several other cases.
- jodrellblank 18y agoAs it stands, help isn't a string - if it was then typing help() would tell you that strings aren't callable. It's a <class site._Helper> So as well as printing that message, it could go into interactive help mode. Since you're only going to want that at the console it could only happen at the console, and since you typed "help" you probably want "help", that would be ... helpful. The real problem with DWIM is that nobody else has the same WIM. (But that's not my problem, because it's all of you who are wrong. ;)