[pypy-dev] Error Messages

Carl Friedrich Bolz cfbolz at gmx.de
Tue Apr 26 13:02:36 EDT 2016


Those are simple cases, of course we use the same exception types there. However, if you write exactly the wrong obscure code you sometimes get a different exception type under some conditions. If you report them and they are easily fixable, we will. 

Carl Friedrich

On April 26, 2016 6:38:31 PM GMT+02:00, Steven D'Aprano <steve at pearwood.info> wrote:
>On Tue, Apr 26, 2016 at 06:16:39PM +0200, Maciej Fijalkowski wrote:
>
>> 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
>
>Do you mean that PyPy might change ValueError to TypeError, or vice 
>versa? Like this:
>
># TypeError in CPython
>len(None)
>=> raises ValueError
>
># ValueError in CPython
>[].index("a")
>=> raises TypeError
>
>That doesn't sound good to me.
>
>If I have misunderstood you, and you're just talking about the error 
>strings, then that's fine.
>
>
>
>-- 
>Steve
>_______________________________________________
>pypy-dev mailing list
>pypy-dev at python.org
>https://mail.python.org/mailman/listinfo/pypy-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20160426/3e7d0096/attachment.html>


More information about the pypy-dev mailing list