Updates:
Labels: WrongResult
Comment #11 on issue 760 by [email protected]: Improvements to
Basic.is_number
http://code.google.com/p/sympy/issues/detail?id=760
The idea is to override it with a class attribute only in the classes where
all/none of the instances are numbers. However, doing that hides the
docstring, so I'm not sure it's such a good idea.
Anyway, there are problems with the current implementation:
* It's confusing because it relies on the fact that atomic numbers have no
args which makes all(obj.is_number for obj in self.iter_basic_args())
return True
* It's wrong in some cases: Tuple(Integer(1)).is_number -> True
* It doesn't really make sense anyway outside Expr instances
So, I think that:
* The current implementation of Basic.is_number should be moved to
Expr.is_number
* Basic.is_number should return False or be removed altogether
* Number.is_number should be explicitly implemented and return True
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.