I think you are right that this code could be simplified  using sign,
but I can't see how to remove if on type of relation.
I'll give it a try, thanks.
I'll also replace if by elif where possible.


2013/3/19 Matthew Rocklin <notifications@github.com>

> In sympy/assumptions/handlers/order.py:
>
> > +                        return False
> > +                if relation is LessThan:
> > +                    if (expr > args[1] - args[0]) is True:
> > +                        return True
> > +                    if (expr < args[0] - args[1]) is True:
> > +                        return False
> > +                if relation is StrictGreaterThan:
> > +                    if (expr >= args[0] - args[1]) is True:
> > +                        return True
> > +                    if (expr <= args[1] - args[0]) is True:
> > +                        return False
> > +                if relation is StrictLessThan:
> > +                    if (expr >= args[1] - args[0]) is True:
> > +                        return True
> > +                    if (expr <= args[0] - args[1]) is True:
> > +                        return False
>
> Is there a way to refactor this to be more concise? Large if-else branches
> like this often cause problems in the future. They are very difficult to
> change in the future without generating bugs that are difficult to track
> down.
>
> Also, are you sure that there isn't already functionality somewhere in
> SymPy that could solve this problem for you? I wonder if something like a
> sign function might be a good place for this.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/sympy/sympy/pull/1907/files#r3432915>
> .
>