Comment #82 on issue 1598 by smichr: New polynomials manipulation module
http://code.google.com/p/sympy/issues/detail?id=1598

I'm not sure that I understand you :-) In the comparison method, I would write

def __eq__(a, b):
   if not isinstance(b, AlgebraicNumber):
       return False
...

rather than

def __eq__(a, b):
    if not b.is_Algebraic:
...

since other may be a simple integer and not have the is_AlgebraicNumber property.

Then a test like AlgebraicNumber(sqrt(2)) == 'foo' will not raise an exception.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to