[pypy-dev] Error Messages

Steven D'Aprano steve at pearwood.info
Tue Apr 26 12:38:31 EDT 2016


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


More information about the pypy-dev mailing list