On 29 November 2016 at 20:38, Nathaniel Smith <[email protected]> wrote:
> On Tue, Nov 29, 2016 at 1:05 AM, Victor Stinner
> <[email protected]> wrote:
>> Hi,
>>
>> Python is optimized for performance. Formatting an error message has a
>> cost on performances.
>
> Sure, but we have to look at this on a case-by-case basis. Is there
> really important code out there that's generating NameErrors or
> SyntaxErrors in an inner loop? That seems unlikely to me.

Right, we generally treat error message formatting code as being off
the critical performance path.

In many (most?) cases, the instances of uninformative error message
are just a symptom of the code in question being really *old*, such
that it predates the great many improvements made to the low level
error reporting machinery over the years.

That's not always true (e.g. parser errors are uninformative because
the parser doesn't keep track of the state needed to generate nicer
messages), but it seems to typically be true for runtime errors where
we don't even report the type or representation of a misbehaving
value.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to