From 08bf900dd929f3859110130c98155e4fbe1d95e4 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 5 Oct 2021 16:54:12 -0700 Subject: [PATCH] is_Expression: Undo automatic edit of the definition; deprecate --- src/sage/symbolic/expression.pyx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx index ed615c42429..3f6cb7b0f3d 100644 --- a/src/sage/symbolic/expression.pyx +++ b/src/sage/symbolic/expression.pyx @@ -406,20 +406,24 @@ include "pynac.pxi" include "pynac_impl.pxi" -cpdef bint isinstance(x, Expression): +cpdef bint is_Expression(x): """ Return True if *x* is a symbolic Expression. EXAMPLES:: - sage: from sage.structure.element import Expression - sage: isinstance(x, Expression) + sage: from sage.symbolic.expression import is_Expression + sage: is_Expression(x) + DeprecationWarning: is_Expression is deprecated; + use isinstance(..., sage.structure.element.Expression) instead True - sage: isinstance(2, Expression) + sage: is_Expression(2) False - sage: isinstance(SR(2, Expression)) + sage: is_Expression(SR(2)) True """ + from sage.misc.superseded import deprecation + deprecation(32638, 'is_Expression is deprecated; use isinstance(..., sage.structure.element.Expression) instead') return isinstance(x, Expression)