4 ms·
Why not: - check if a variable called "help" is in scope - if not, call help(). - otherwise, print its value.
by blt 5y ago
Why not:
- check if a variable called "help" is in scope
- if not, call help().
- otherwise, print its value.
- Brian_K_White 5y agoBecause then when there IS a variable, the help command you learned will not work. I think anyone crying and baffled about this is fundamentally not well suited to programming. This sort of logical problem should be intuitive. The seeming irrationality of the special case behavior is just something funny to make your mom laugh, not something that's actually illogical or inconsistent or stupid.
- lou1306 5y agoWhat if you have defined a "help()" function though? REPL should be as dumb as possible. That's a feature, not a bug.