[Python-ideas] (no subject)

Neil Girdhar mistersheik at gmail.com
Sat Dec 24 14:42:46 EST 2016



On Tuesday, November 29, 2016 at 4:08:19 AM UTC-5, Victor Stinner wrote:
>
> Hi, 
>
> Python is optimized for performance. Formatting an error message has a 
> cost on performances. 
>
>
Usually, when an exception is hit that will (probably) crash the program, 
no one cares about less than a microsecond of performance.
 

> 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 
> _______________________________________________ 
> Python-ideas mailing list 
> Python... at python.org <javascript:> 
> https://mail.python.org/mailman/listinfo/python-ideas 
> Code of Conduct: http://python.org/psf/codeofconduct/ 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161224/011eca40/attachment.html>


More information about the Python-ideas mailing list