Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
is_Expression: Undo automatic edit of the definition; deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Oct 5, 2021
1 parent 56d1c36 commit 08bf900
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/sage/symbolic/expression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 08bf900

Please sign in to comment.