[Python-ideas] (no subject)
Victor Stinner
victor.stinner at gmail.com
Tue Nov 29 04:05:12 EST 2016
Hi,
Python is optimized for performance. Formatting an error message has a
cost on performances.
I suggest you to teach your student to use the REPL and use a custom
exception handler: sys.excepthook:
https://docs.python.org/2/library/sys.html#sys.excepthook
Using a custom exception handler, you can run expensive functions,
like the feature: "suggest len when length is used".
The problem is then when students have to use a Python without the
custom exception handler.
Victor
More information about the Python-ideas
mailing list