sympy/sympy — pull request #1153 by smichr (2012-03-21 06:44:12+00:00)
Title: do not rely on is_real for comparable test

When foo.is_number and foo.is_real is used to determine whether
something is positive or negative there are two problems:

1) this discriminates against expressions for which is_real is None
2) this doesn't allow is_positive|negative to answer False for
complex numbers -- they answer None at present

When evaluating is_real|integer, the presence of more than one
argument that does not have that attribute necessitates returning None
rather than False since those two properties may cancel out. A key
word to allow this option has been added to the
operations._eval_template_is_attr function.