Re:Help us collect modern Python NumPy code solutions
by kortex on Monday March 28, 2022 @10:45AM
(#30831002)
I agree eval is pretty gross and folks should not be encouraging its use since it can lead to bad habits.
Quit/exit are pretty innocuous though. I actually just thought exit was an alias for sys.exit. I've never had a problem using plain exit() in programs.
- it might be neat, but advocating for `eval(input())` [0] might not be the safest solution for this problem, especially without explaining the dangers of `eval` (assuming this site is partially aimed at beginners?)
- for an article titled 'how to terminate a script', the suggested method (`quit()`) [1] is specifically described in the official python docs [2] as code that "should not be used in programs".
[0]: https://onelinerhub.com/python/calculator [1]: https://onelinerhub.com/python/how-to-terminate-script [2]: https://docs.python.org/3/library/constants.html#constants-a...