@@ -547,11 +547,6 @@ def _element_constructor_(self, x):
547
547
if P is not self .base_ring ():
548
548
return self .element_class (self , x .monomial_coefficients ())
549
549
550
- if isinstance (P , IntegerValuedPolynomialRing .Binomial ):
551
- phi = P .module_morphism (self ._from_binomial_basis ,
552
- codomain = self )
553
- return phi (x )
554
-
555
550
# ok, not a integer-valued polynomial ring element
556
551
R = self .base_ring ()
557
552
# coercion via base ring
@@ -653,7 +648,8 @@ def _coerce_map_from_(self, R):
653
648
if isinstance (R , IntegerValuedPolynomialRing .Shifted ):
654
649
return self .base_ring ().has_coerce_map_from (R .base_ring ())
655
650
if isinstance (R , IntegerValuedPolynomialRing .Binomial ):
656
- return self .base_ring ().has_coerce_map_from (R .base_ring ())
651
+ return R .module_morphism (self ._from_binomial_basis ,
652
+ codomain = self )
657
653
return self .base_ring ().has_coerce_map_from (R )
658
654
659
655
def _poly (self , i ):
@@ -990,11 +986,6 @@ def _element_constructor_(self, x):
990
986
if P is not self .base_ring ():
991
987
return self .element_class (self , x .monomial_coefficients ())
992
988
993
- if isinstance (P , IntegerValuedPolynomialRing .Shifted ):
994
- psi = P .module_morphism (self ._from_shifted_basis ,
995
- codomain = self )
996
- return psi (x )
997
-
998
989
# ok, not a integer-valued polynomial ring element
999
990
R = self .base_ring ()
1000
991
# coercion via base ring
@@ -1092,7 +1083,8 @@ def _coerce_map_from_(self, R):
1092
1083
if isinstance (R , IntegerValuedPolynomialRing .Binomial ):
1093
1084
return self .base_ring ().has_coerce_map_from (R .base_ring ())
1094
1085
if isinstance (R , IntegerValuedPolynomialRing .Shifted ):
1095
- return self .base_ring ().has_coerce_map_from (R .base_ring ())
1086
+ return R .module_morphism (self ._from_shifted_basis ,
1087
+ codomain = self )
1096
1088
return self .base_ring ().has_coerce_map_from (R )
1097
1089
1098
1090
def _poly (self , i ):
0 commit comments