|
62 | 62 | import sage.rings.number_field.number_field_base as number_field_base
|
63 | 63 | from sage.misc.fast_methods import Singleton
|
64 | 64 | from sage.misc.superseded import deprecated_function_alias
|
65 |
| -from sage.structure.parent_gens import ParentWithGens |
| 65 | +from sage.structure.parent import Parent |
66 | 66 | from sage.structure.sequence import Sequence
|
67 | 67 |
|
68 | 68 |
|
@@ -235,8 +235,9 @@ def __init__(self):
|
235 | 235 | """
|
236 | 236 | from sage.categories.basic import QuotientFields
|
237 | 237 | from sage.categories.number_fields import NumberFields
|
238 |
| - ParentWithGens.__init__(self, self, category=[QuotientFields().Metric(), |
239 |
| - NumberFields()]) |
| 238 | + Parent.__init__(self, base=self, |
| 239 | + category=[QuotientFields().Metric(), |
| 240 | + NumberFields()]) |
240 | 241 | self._assign_names(('x',), normalize=False) # ?????
|
241 | 242 | self._populate_coercion_lists_(init_no_parent=True)
|
242 | 243 |
|
@@ -862,7 +863,7 @@ def hilbert_symbol_negative_at_S(self, S, b, check=True):
|
862 | 863 | if p != infty:
|
863 | 864 | if check and not is_prime(p):
|
864 | 865 | raise ValueError("all entries in list must be prime"
|
865 |
| - " or -1 for infinite place") |
| 866 | + " or -1 for infinite place") |
866 | 867 | R = Qp(p)
|
867 | 868 | if R(b).is_square():
|
868 | 869 | raise ValueError("second argument must be a nonsquare with"
|
@@ -1055,7 +1056,7 @@ def power_basis(self):
|
1055 | 1056 | sage: QQ.power_basis()
|
1056 | 1057 | [1]
|
1057 | 1058 | """
|
1058 |
| - return [ self.gen() ] |
| 1059 | + return [self.gen()] |
1059 | 1060 |
|
1060 | 1061 | def extension(self, poly, names, **kwds):
|
1061 | 1062 | r"""
|
@@ -1133,7 +1134,7 @@ def _an_element_(self):
|
1133 | 1134 | sage: QQ.an_element() # indirect doctest
|
1134 | 1135 | 1/2
|
1135 | 1136 | """
|
1136 |
| - return Rational((1,2)) |
| 1137 | + return Rational((1, 2)) |
1137 | 1138 |
|
1138 | 1139 | def some_elements(self):
|
1139 | 1140 | r"""
|
@@ -1247,7 +1248,7 @@ def random_element(self, num_bound=None, den_bound=None, *args, **kwds):
|
1247 | 1248 | den = ZZ.random_element(1, den_bound+1, *args, **kwds)
|
1248 | 1249 | while den == 0:
|
1249 | 1250 | den = ZZ.random_element(1, den_bound+1, *args, **kwds)
|
1250 |
| - return self((num,den)) |
| 1251 | + return self((num, den)) |
1251 | 1252 |
|
1252 | 1253 | def zeta(self, n=2):
|
1253 | 1254 | """
|
@@ -1381,7 +1382,7 @@ def selmer_group_iterator(self, S, m, proof=True):
|
1381 | 1382 |
|
1382 | 1383 | from sage.misc.misc_c import prod
|
1383 | 1384 | for ev in product(*[range(o) for o in ords]):
|
1384 |
| - yield prod((p**e for p,e in zip(KSgens, ev)), one) |
| 1385 | + yield prod((p**e for p, e in zip(KSgens, ev)), one) |
1385 | 1386 |
|
1386 | 1387 | def selmer_space(self, S, p, proof=None):
|
1387 | 1388 | r"""
|
@@ -1520,7 +1521,7 @@ def quadratic_defect(self, a, p, check=True):
|
1520 | 1521 | return v + 1
|
1521 | 1522 |
|
1522 | 1523 | #################################
|
1523 |
| - ## Coercions to interfaces |
| 1524 | + # Coercions to interfaces |
1524 | 1525 | #################################
|
1525 | 1526 | def _gap_init_(self):
|
1526 | 1527 | r"""
|
@@ -1658,12 +1659,12 @@ def _factor_univariate_polynomial(self, f):
|
1658 | 1659 | (10) * (x^5 - 1/10)
|
1659 | 1660 | sage: QQ._factor_univariate_polynomial(10*x^5 - 10)
|
1660 | 1661 | (10) * (x - 1) * (x^4 + x^3 + x^2 + x + 1)
|
1661 |
| -
|
1662 | 1662 | """
|
1663 |
| - G = list(f._pari_with_name().factor()) |
| 1663 | + G = f._pari_with_name().factor() |
1664 | 1664 |
|
1665 | 1665 | # normalize the leading coefficients
|
1666 |
| - F = [(f.parent()(g).monic(), int(e)) for (g,e) in zip(*G)] |
| 1666 | + P = f.parent() |
| 1667 | + F = [(P(g).monic(), int(e)) for g, e in zip(*G)] |
1667 | 1668 |
|
1668 | 1669 | from sage.structure.factorization import Factorization
|
1669 | 1670 | return Factorization(F, f.leading_coefficient())
|
|
0 commit comments