sage.structure.element: Add abc Expression; deprecate is_Expression etc.
Closed this issue · 34 comments
(part of meta-ticket #32414)
in sage.structure.element, we add a class Expression
- the existing class
sage.symbolic.expression.Expressionwill be its only subclass - deprecate
is_Expression, replace uses byisinstance(x, sage.structure.element.Expression)
Follow-up in #32665: Also deprecate is_SymbolicEquation, is_CallableSymbolicExpression, is_SymbolicVariable; replace uses by isinstance(x, Expression) and a method call (may need a new method is_callable)
Depends on #32599
CC: @DaveWitteMorris @tscrim @mjungmath
Component: refactoring
Author: Matthias Koeppe
Branch/Commit: ee7640c
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/32638
New commits:
37ee682 | sage.structure.element.Expression: New abc for sage.symbolic.expression.Expression |
Description changed:
---
+++
@@ -1,6 +1,6 @@
(part of meta-ticket #32414)
in `sage.structure.element`, we add a class `Expression`
-- the existing class `sage.symbolic.expression.Expression` will be renamed to `Expression_pynac` and be its only subclass
+- the existing class `sage.symbolic.expression.Expression` will be its only subclass
- deprecate `is_Expression`, `is_SymbolicEquation`, `is_CallableSymbolicExpression`, `is_SymbolicVariable`; replace uses by `isinstance(x, Expression)` and a method call (may need a new method `is_callable`)
Branch pushed to git repo; I updated commit sha1. New commits:
56d1c36 | git grep -l -E 'is_Expression' | xargs sed -E -i.bak 's/sage[.]symbolic.*import is_Expression *$/sage.structure.element import Expression/;s/is_Expression[(]([^)]*)[)]/isinstance(\1, Expression)/g;' |
08bf900 | is_Expression: Undo automatic edit of the definition; deprecate |
Description changed:
---
+++
@@ -2,5 +2,7 @@
in `sage.structure.element`, we add a class `Expression`
- the existing class `sage.symbolic.expression.Expression` will be its only subclass
-- deprecate `is_Expression`, `is_SymbolicEquation`, `is_CallableSymbolicExpression`, `is_SymbolicVariable`; replace uses by `isinstance(x, Expression)` and a method call (may need a new method `is_callable`)
+- deprecate `is_Expression`
+Follow-up: Also deprecate `is_SymbolicEquation`, `is_CallableSymbolicExpression`, `is_SymbolicVariable`; replace uses by `isinstance(x, Expression)` and a method call (may need a new method `is_callable`)
+Author: Matthias Koeppe
setting to needs_review so that the patchbot runs
Branch pushed to git repo; I updated commit sha1. New commits:
4e5fe35 | src/sage/symbolic/expression.pxd: Undo automatic edit |
Branch pushed to git repo; I updated commit sha1. New commits:
e14259b | src/sage/ext/fast_callable.pyx: Fix up clash of sage.ext.fast_callable.Expression and sage.structure.element.Expression |
Branch pushed to git repo; I updated commit sha1. New commits:
daed11e | src/sage/symbolic/function.pyx: Update imports |
Branch pushed to git repo; I updated commit sha1. New commits:
c52251b | src/sage/symbolic/ring.pyx: Update imports |
Description changed:
---
+++
@@ -2,7 +2,7 @@
in `sage.structure.element`, we add a class `Expression`
- the existing class `sage.symbolic.expression.Expression` will be its only subclass
-- deprecate `is_Expression`
+- deprecate `is_Expression`, replace uses by `isinstance(x, sage.structure.element.Expression)`
Follow-up: Also deprecate `is_SymbolicEquation`, `is_CallableSymbolicExpression`, `is_SymbolicVariable`; replace uses by `isinstance(x, Expression)` and a method call (may need a new method `is_callable`)
Branch pushed to git repo; I updated commit sha1. New commits:
88886ee | src/sage/symbolic/expression.pyx: Fix doctest output |
Branch pushed to git repo; I updated commit sha1. New commits:
cf9b75a | src/sage/symbolic/relation.py: Remove unused import; use sage.structure.element.Expression for isinstance |
LGTM.
Reviewer: Travis Scrimshaw
Thank you!
Description changed:
---
+++
@@ -4,5 +4,5 @@
- the existing class `sage.symbolic.expression.Expression` will be its only subclass
- deprecate `is_Expression`, replace uses by `isinstance(x, sage.structure.element.Expression)`
-Follow-up: Also deprecate `is_SymbolicEquation`, `is_CallableSymbolicExpression`, `is_SymbolicVariable`; replace uses by `isinstance(x, Expression)` and a method call (may need a new method `is_callable`)
+Follow-up in #32665: Also deprecate `is_SymbolicEquation`, `is_CallableSymbolicExpression`, `is_SymbolicVariable`; replace uses by `isinstance(x, Expression)` and a method call (may need a new method `is_callable`)
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
ec8400b | Merge tag '9.5.beta3' into t/32638/sage_structure_element__add_abc_expression__deprecate_is_expression_etc_ |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
8e27fdc | src/sage/structure/sequence.py: Do not fail if polynomial rings cannot be imported |
b43a50c | src/sage/sets/condition_set.py: Do not fail if sage.symbolic cannot be imported |
73aabd2 | src/sage/sets/condition_set.py: Fix up import |
ee7640c | Merge #32599 |
Changed branch from u/mkoeppe/sage_structure_element__add_abc_expression__deprecate_is_expression_etc_ to ee7640c