Attached patch adds _is_symbol(), _is_constant() and _is_numeric() methods to sage.symbolic.expression.Expression objects.
These methods are just a thin wrapper around the is_a<*>() methods from pynac. They should provide a straightforward interface to query the internal representation of a symbolic expression when .operator() returns None.
Some relevant discussion on sage-devel:
http://groups.google.com/group/sage-devel/msg/6323b473af195bc7
CC: @sagetrac-fmaltey
Component: symbolics
Author: Burcin Erocal
Reviewer: Mike Hansen
Merged: sage-4.3.rc0
Issue created by migration from https://trac.sagemath.org/ticket/7603
Attached patch adds
_is_symbol(),_is_constant()and_is_numeric()methods tosage.symbolic.expression.Expressionobjects.These methods are just a thin wrapper around the
is_a<*>()methods from pynac. They should provide a straightforward interface to query the internal representation of a symbolic expression when.operator()returns None.Some relevant discussion on sage-devel:
http://groups.google.com/group/sage-devel/msg/6323b473af195bc7
CC: @sagetrac-fmaltey
Component: symbolics
Author: Burcin Erocal
Reviewer: Mike Hansen
Merged: sage-4.3.rc0
Issue created by migration from https://trac.sagemath.org/ticket/7603