diff --git a/src/sage/combinat/sf/classical.py b/src/sage/combinat/sf/classical.py index 792272417a8..badea76a0c5 100644 --- a/src/sage/combinat/sf/classical.py +++ b/src/sage/combinat/sf/classical.py @@ -155,7 +155,7 @@ def _element_constructor_(self, x): ############## # Dual bases # ############## - elif sfa.is_SymmetricFunction(x) and hasattr(x, 'dual'): + elif isinstance(x, sfa.SymmetricFunctionAlgebra_generic.Element) and hasattr(x, 'dual'): # Check to see if it is the dual of some other basis # If it is, try to coerce its corresponding element # in the other basis diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 033a753f076..36168bd7e1e 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -304,12 +304,20 @@ def is_SymmetricFunction(x): sage: from sage.combinat.sf.sfa import is_SymmetricFunction sage: s = SymmetricFunctions(QQ).s() sage: is_SymmetricFunction(2) + doctest:warning... + DeprecationWarning: The function is_SymmetricFunction is deprecated; + use 'isinstance(..., SymmetricFunctionAlgebra_generic.Element)' instead. + See https://github.com/sagemath/sage/issues/38279 for details. False sage: is_SymmetricFunction(s(2)) True sage: is_SymmetricFunction(s([2,1])) True """ + from sage.misc.superseded import deprecation + deprecation(38279, + "The function is_SymmetricFunction is deprecated; " + "use 'isinstance(..., SymmetricFunctionAlgebra_generic.Element)' instead.") return isinstance(x, SymmetricFunctionAlgebra_generic.Element) ##################################################################### @@ -3429,7 +3437,7 @@ def plethysm(self, x, include=None, exclude=None): tHA = HopfAlgebrasWithBasis(R).TensorProducts() tensorflag = Px in tHA - if not is_SymmetricFunction(x): + if not isinstance(x, SymmetricFunctionAlgebra_generic.Element): if R.has_coerce_map_from(Px) or x in R: x = R(x) Px = R diff --git a/src/sage/rings/lazy_series.py b/src/sage/rings/lazy_series.py index 74744c311da..4aab7395464 100644 --- a/src/sage/rings/lazy_series.py +++ b/src/sage/rings/lazy_series.py @@ -6981,9 +6981,8 @@ def functorial_composition(self, *args): """ if len(args) != self.parent()._arity: raise ValueError("arity must be equal to the number of arguments provided") - from sage.combinat.sf.sfa import is_SymmetricFunction - if not all(isinstance(g, LazySymmetricFunction) - or is_SymmetricFunction(g) + from sage.combinat.sf.sfa import SymmetricFunctionAlgebra_generic + if not all(isinstance(g, (LazySymmetricFunction, SymmetricFunctionAlgebra_generic.Element)) or not g for g in args): raise ValueError("all arguments must be (possibly lazy) symmetric functions") @@ -7200,9 +7199,8 @@ def arithmetic_product(self, *args): """ if len(args) != self.parent()._arity: raise ValueError("arity must be equal to the number of arguments provided") - from sage.combinat.sf.sfa import is_SymmetricFunction - if not all(isinstance(g, LazySymmetricFunction) - or is_SymmetricFunction(g) + from sage.combinat.sf.sfa import SymmetricFunctionAlgebra_generic + if not all(isinstance(g, (LazySymmetricFunction, SymmetricFunctionAlgebra_generic.Element)) or not g for g in args): raise ValueError("all arguments must be (possibly lazy) symmetric functions")