[pypy-dev] Error Messages

Maciej Fijalkowski fijall at gmail.com
Tue Apr 26 12:47:48 EDT 2016


Not in *those* cases, but there are cases where CPython would raise
different error classes depending e.g. on whether stuff is builtin
function or not builtin function or the cpython errors are
inconsistent. In those cases the exact error might be a bit different
(I must admit I don't remember examples off hand)

On Tue, Apr 26, 2016 at 6:38 PM, 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


More information about the pypy-dev mailing list