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 <st...@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@python.org
>https://mail.python.org/mailman/listinfo/pypy-dev
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to