[pypy-dev] Error Messages

Maciej Fijalkowski fijall at gmail.com
Tue Apr 26 12:16:39 EDT 2016


On Tue, Apr 26, 2016 at 5:30 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> On Tue, Apr 26, 2016 at 10:16:29AM -0500, Ryan Gonzalez wrote:
>> I personally think it's fine:
>>
>> 1. CPython has pretty decent error messages. Other than long stack traces
>> with recursion errors, or maybe column offsets, there isn't really anything
>> that could be significantly improved.
>
> Well, I don't know about that... some of the error messages are a bit
> uninformative ("SyntaxError: invalid syntax", although it may be
> difficult to do much about that one). But potential improvements
> should be taken on a case-by-case basis.
>
>
>> 2. Changing the actual errors would likely break...a *lot*!
>
> Do you mean the exception types? Yes, changing the exception types would
> break a lot of code. But changing the error messages shouldn't break
> anything, since the error messages are not part of the function API.
> They've changed before, and they will change again.

Typically the exception type is the same, but there is a bunch of
differences, especially around ValueError vs TypeError, noone should
rely on that anyway


More information about the pypy-dev mailing list