Or, since the location of the error is part of the standard error
reporting, just `"expecting 1 or 2 but got %s" % p`


On Wed, Dec 11, 2013 at 12:43 PM, Joachim Durchholz <
notifications@github.com> wrote:

> In examples/advanced/qft.py:
>
> > @@ -38,7 +38,8 @@
> >
> >  def u(p, r):
> >      """ p = (p1, p2, p3); r = 0,1 """
> > -    assert r in [1, 2]
> > +    if r not in [1, 2]:
> > +        raise ValueError("Function called for incorrect value")
>
> It would be better to say a bit more about what's wrong, e.g. "p must be 1
> or 2 in r(u,p), but it is 5".
>
> This applies to virtually all fixes.
> (I'm aware that this goes beyond the original issue.)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/sympy/sympy/pull/2655/files#r8276637>
> .
>