@@ -219,24 +219,25 @@ def __init__(self, x, unit=None, cr=False, sort=True, simplify=True):
219
219
220
220
INPUT:
221
221
222
- - ``x`` - a list of pairs (p, e) with e an integer;
223
- otherwise a TypeError is raised
222
+ - ``x`` -- a list of pairs (p, e) with e an integer;
223
+ otherwise a :class:` TypeError` is raised
224
224
225
- - ``unit`` - (default: 1) the unit part of the factorization.
225
+ - ``unit`` -- (default: 1) the unit part of the factorization.
226
226
227
- - ``cr`` - (default: False) if True, print the factorization with
228
- carriage returns between factors.
227
+ - ``cr`` -- (default: `` False`` ) if `` True`` , print the factorization
228
+ with carriage returns between factors.
229
229
230
- - ``sort`` - (default: True) if True, sort the factors by calling
231
- the sort function ``self.sort()`` after creating the factorization
230
+ - ``sort`` - (default: ``True``) if ``True``, sort the factors by
231
+ calling the sort function ``self.sort()`` after creating
232
+ the factorization
232
233
233
- - ``simplify`` - (default: True) if True, remove duplicate
234
+ - ``simplify`` - (default: `` True`` ) if `` True`` , remove duplicate
234
235
factors from the factorization. See the documentation for
235
236
self.simplify.
236
237
237
238
OUTPUT:
238
239
239
- - a Factorization object
240
+ a Factorization object
240
241
241
242
EXAMPLES:
242
243
@@ -319,7 +320,7 @@ def __init__(self, x, unit=None, cr=False, sort=True, simplify=True):
319
320
320
321
def __getitem__ (self , i ):
321
322
"""
322
- Return `i^{th}` factor of self.
323
+ Return `i^{th}` factor of `` self`` .
323
324
324
325
EXAMPLES::
325
326
@@ -340,7 +341,7 @@ def __getitem__(self, i):
340
341
341
342
def __setitem__ (self , i , v ):
342
343
"""
343
- Set the `i^{th}` factor of self.
344
+ Set the `i^{th}` factor of `` self`` .
344
345
345
346
.. warning::
346
347
@@ -359,7 +360,7 @@ def __setitem__(self, i, v):
359
360
360
361
def __len__ (self ):
361
362
"""
362
- Return the number of prime factors of self, not counting
363
+ Return the number of prime factors of `` self`` , not counting
363
364
the unit part.
364
365
365
366
EXAMPLES::
@@ -435,11 +436,11 @@ def __richcmp__(self, other, op):
435
436
436
437
def __copy__ (self ):
437
438
r"""
438
- Return a copy of self.
439
+ Return a copy of `` self`` .
439
440
440
441
This is *not* a deepcopy -- only references to the factors are
441
442
returned, not copies of them. Use ``deepcopy(self)`` if you need
442
- a deep copy of self.
443
+ a deep copy of `` self`` .
443
444
444
445
EXAMPLES:
445
446
@@ -469,7 +470,7 @@ def __copy__(self):
469
470
470
471
def __deepcopy__ (self , memo ):
471
472
r"""
472
- Return a deep copy of self.
473
+ Return a deep copy of `` self`` .
473
474
474
475
EXAMPLES:
475
476
@@ -537,7 +538,7 @@ def universe(self):
537
538
538
539
def base_change (self , U ):
539
540
"""
540
- Return the factorization self, with its factors (including the
541
+ Return the factorization `` self`` , with its factors (including the
541
542
unit part) coerced into the universe `U`.
542
543
543
544
EXAMPLES::
@@ -549,7 +550,7 @@ def base_change(self, U):
549
550
sage: F.base_change(P).universe()
550
551
Univariate Polynomial Ring in x over Integer Ring
551
552
552
- This method will return a TypeError if the coercion is not
553
+ This method will return a :class:` TypeError` if the coercion is not
553
554
possible::
554
555
555
556
sage: g = x^2 - 1
@@ -571,7 +572,7 @@ def base_change(self, U):
571
572
572
573
def is_commutative (self ) -> bool :
573
574
"""
574
- Return True if my factors commute.
575
+ Return `` True`` if my factors commute.
575
576
576
577
EXAMPLES::
577
578
@@ -650,7 +651,7 @@ def sort(self, key=None):
650
651
651
652
INPUT:
652
653
653
- - ``key`` - (default: ``None``) comparison key
654
+ - ``key`` -- (default: ``None``) comparison key
654
655
655
656
OUTPUT:
656
657
@@ -800,7 +801,7 @@ def _repr_(self):
800
801
sage: f
801
802
factorization of -100
802
803
803
- However _repr_ always prints normally::
804
+ However `` _repr_`` always prints normally::
804
805
805
806
sage: f._repr_()
806
807
'-1 * 2^2 * 5^2'
@@ -924,7 +925,7 @@ def __pari__(self):
924
925
925
926
def __add__ (self , other ):
926
927
"""
927
- Return the (unfactored) sum of self and other.
928
+ Return the (unfactored) sum of `` self`` and `` other`` .
928
929
929
930
EXAMPLES::
930
931
@@ -941,7 +942,7 @@ def __add__(self, other):
941
942
942
943
def __sub__ (self , other ):
943
944
"""
944
- Return the (unfactored) difference of self and other.
945
+ Return the (unfactored) difference of `` self`` and `` other`` .
945
946
946
947
EXAMPLES::
947
948
@@ -956,7 +957,7 @@ def __sub__(self, other):
956
957
957
958
def __radd__ (self , left ):
958
959
"""
959
- Return the (unfactored) sum of self and left.
960
+ Return the (unfactored) sum of `` self`` and `` left`` .
960
961
961
962
EXAMPLES::
962
963
@@ -967,7 +968,7 @@ def __radd__(self, left):
967
968
968
969
def __rsub__ (self , left ):
969
970
"""
970
- Return the (unfactored) difference of left and self.
971
+ Return the (unfactored) difference of `` left`` and `` self`` .
971
972
972
973
EXAMPLES::
973
974
@@ -995,7 +996,7 @@ def __neg__(self):
995
996
996
997
def __rmul__ (self , left ):
997
998
"""
998
- Return the product left * self, where left is not a Factorization.
999
+ Return the product `` left * self`` , where `` left`` is not a Factorization.
999
1000
1000
1001
EXAMPLES::
1001
1002
@@ -1028,7 +1029,7 @@ def __mul__(self, other):
1028
1029
1029
1030
If the two factorizations have different universes, this
1030
1031
method will attempt to find a common universe for the
1031
- product. A TypeError is raised if this is impossible.
1032
+ product. A :class:` TypeError` is raised if this is impossible.
1032
1033
1033
1034
EXAMPLES::
1034
1035
@@ -1179,6 +1180,8 @@ def __call__(self, *args, **kwds):
1179
1180
"""
1180
1181
Implement the substitution.
1181
1182
1183
+ This is assuming that each term can be substituted.
1184
+
1182
1185
There is another mechanism for substitution
1183
1186
in symbolic products.
1184
1187
@@ -1240,7 +1243,7 @@ def gcd(self, other):
1240
1243
1241
1244
If the two factorizations have different universes, this
1242
1245
method will attempt to find a common universe for the
1243
- gcd. A TypeError is raised if this is impossible.
1246
+ gcd. A :class:` TypeError` is raised if this is impossible.
1244
1247
1245
1248
EXAMPLES::
1246
1249
@@ -1282,7 +1285,7 @@ def lcm(self, other):
1282
1285
1283
1286
If the two factorizations have different universes, this
1284
1287
method will attempt to find a common universe for the
1285
- lcm. A TypeError is raised if this is impossible.
1288
+ lcm. A :class:` TypeError` is raised if this is impossible.
1286
1289
1287
1290
EXAMPLES::
1288
1291
@@ -1320,7 +1323,7 @@ def lcm(self, other):
1320
1323
1321
1324
def is_integral (self ) -> bool :
1322
1325
r"""
1323
- Return True iff all exponents of this Factorization are non-negative.
1326
+ Return whether all exponents of this Factorization are non-negative.
1324
1327
1325
1328
EXAMPLES::
1326
1329
@@ -1338,11 +1341,11 @@ def is_integral(self) -> bool:
1338
1341
1339
1342
def radical (self ):
1340
1343
"""
1341
- Return the factorization of the radical of the value of self.
1344
+ Return the factorization of the radical of the value of `` self`` .
1342
1345
1343
1346
First, check that all exponents in the factorization are
1344
- positive, raise ValueError otherwise. If all exponents are
1345
- positive, return self with all exponents set to 1 and with the
1347
+ positive, raise :class:` ValueError` otherwise. If all exponents are
1348
+ positive, return `` self`` with all exponents set to 1 and with the
1346
1349
unit set to 1.
1347
1350
1348
1351
EXAMPLES::
@@ -1358,18 +1361,18 @@ def radical(self):
1358
1361
"""
1359
1362
if not all (e > 0 for _ , e in self .__x ):
1360
1363
raise ValueError ("all exponents in the factorization must be positive" )
1361
- return Factorization ([(p , 1 ) for p , e in self .__x ], unit = self .unit ().parent ()(1 ),
1364
+ return Factorization ([(p , 1 ) for p , _ in self .__x ], unit = self .unit ().parent ()(1 ),
1362
1365
cr = self .__cr , sort = False , simplify = False )
1363
1366
1364
1367
def radical_value (self ):
1365
1368
"""
1366
- Return the product of the prime factors in self.
1369
+ Return the product of the prime factors in `` self`` .
1367
1370
1368
1371
First, check that all exponents in the factorization are
1369
- positive, raise ValueError otherwise. If all exponents are
1370
- positive, return the product of the prime factors in self.
1372
+ positive, raise :class:` ValueError` otherwise. If all exponents are
1373
+ positive, return the product of the prime factors in `` self`` .
1371
1374
This should be functionally equivalent to
1372
- self.radical().value()
1375
+ `` self.radical().value()``.
1373
1376
1374
1377
EXAMPLES::
1375
1378
0 commit comments