Ticket #9944: 9944diff

File 9944diff, 3.7 KB (added by SimonKing, 8 years ago)

diff file for old and new patch version

Line 
13,5c3,5
2< # Date 1305544525 -7200
3< # Node ID 97c20526215a35957e2f8dc775b10e6c5d2b1b2a
4< # Parent  b5e5e417fa7829eb3149f0ae431721aac5610ecd
5---
6> # Date 1305716078 -7200
7> # Node ID 93f1d2b12b726d98a28e3eb8f18e47df9bfaa3c8
8> # Parent  14b58788c951a16ed2b6ef0cc748758faed602e8
913c13
10< @@ -989,9 +989,9 @@
11---
12> @@ -971,9 +971,9 @@
13315c315
14< @@ -119,16 +124,39 @@
15---
16> @@ -119,16 +124,42 @@
17320c320,323
18< +        The following tests against a bug that was fixed in trac ticket #9944::
19---
20> +        The following tests against a bug that was fixed in trac
21> +        ticket #9944. The method ``zero()`` calls this hom space with
22> +        a function, not with a matrix, and that case had previously
23> +        not been taken care of::
24323c326
25< +            sage: V.Hom(V).zero()
26---
27> +            sage: V.Hom(V).zero()   # indirect doctest
28360c363
29< @@ -137,7 +165,8 @@
30---
31> @@ -137,7 +168,8 @@
32370c373
33< @@ -158,7 +187,8 @@
34---
35> @@ -158,7 +190,8 @@
361090a1094,1102
37> @@ -5317,7 +5339,7 @@
38>         
39>          EXAMPLES::
40>         
41> -            sage: R.<x> = ZZ[]; S.<y> = R[]
42> +            sage: R.<x> = ZZ[]; S.<y> = PolynomialRing(R, sparse=True)
43>              sage: f = y^3 + x*y -3*x; f
44>              y^3 + x*y - 3*x
45>              sage: f.truncate(2)
461494c1506
47< @@ -6101,34 +6172,43 @@
48---
49> @@ -6101,34 +6172,12 @@
501503,1512c1515,1516
51< +        self._new_constant_poly_ = self._an_element._new_constant_poly
52< +        return
53< +        # this is likely to be overridden below:
54< +        try:
55< +            self._new_constant_poly_ = self._an_element._new_constant_poly
56< +        except AttributeError:
57< +            self._new_constant_poly_ = codomain.__call__
58< +        return
59<          if domain is codomain: # some rings are base rings of themselves!
60<              return
61---
62> -        if domain is codomain: # some rings are base rings of themselves!
63> -            return
641517,1518c1521
65< +        if not is_PolynomialRing(domain):
66<              try:
67---
68> -            try:
691520,1530c1523,1524
70< +                one = codomain._element_constructor_(domain.one_element())
71<              except (AttributeError, NotImplementedError, TypeError):
72< +                # perhaps it uses the old model?
73< +                try:
74< +                    one = codomain._coerce_c(domain.one_element())
75< +                except (AttributeError, NotImplementedError, TypeError):
76< +                    return
77< +            try:
78< +                one_rmul_ = one._rmul_
79< +            except AttributeError:
80<                  return
81---
82> -            except (AttributeError, NotImplementedError, TypeError):
83> -                return
841545,1553c1539
85< +            # For the p-adic fields, _lmul_ and _rmul_ return None!!!
86< +            # To work around, we need to test its sanity before we try
87< +            # to use it.
88< +            try:
89< +                if one_rmul_(domain.one_element()) is None:
90< +                    return
91< +                self._new_constant_poly_ = one_rmul_
92< +            except TypeError:
93< +                pass
94---
95> +        self._new_constant_poly_ = self._an_element._new_constant_poly
961558c1544
97< @@ -6142,9 +6222,7 @@
98---
99> @@ -6142,9 +6191,7 @@
1001569c1555
101< @@ -6154,7 +6232,12 @@
102---
103> @@ -6154,7 +6201,12 @@
1041729c1715
105< +            mpfr_set_si(self._coeffs[i], PyInt_AS_LONG(int(0)), rnd)
106---
107> +            mpfr_set_si(self._coeffs[0], PyInt_AS_LONG(int(0)), rnd)
1081913c1899
109< +        Caveat: There is no coercion from a sparse into a dense
110---
111> +        Caveat: There is no coercion from a dense into a sparse
1123318c3304
113< @@ -761,7 +761,7 @@
114---
115> @@ -760,7 +760,7 @@
1163327c3313
117< @@ -1483,7 +1483,7 @@
118---
119> @@ -1272,7 +1272,7 @@
1203350c3336
121< @@ -104,10 +107,10 @@
122---
123> @@ -102,10 +105,10 @@