Skip to content

Commit d1075d8

Browse files
author
Release Manager
committed
gh-40083: using _an_element_ in modular/ in two files about Multiple Zeta Values ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: #40083 Reported by: Frédéric Chapoton Reviewer(s): Travis Scrimshaw
2 parents 353c544 + ee8f9f3 commit d1075d8

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/sage/modular/multiple_zeta.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ class MultizetaValues(Singleton):
420420
sage: parent(M((2,3,4,5), prec=128))
421421
Real Field with 128 bits of precision
422422
"""
423-
def __init__(self):
423+
def __init__(self) -> None:
424424
"""
425425
When first called, pre-compute up to weight 8 at precision 1024.
426426
@@ -443,7 +443,7 @@ def __repr__(self) -> str:
443443
"""
444444
return f"Cached multiple zeta values at precision {self.prec} up to weight {self.max_weight}"
445445

446-
def reset(self, max_weight=8, prec=1024):
446+
def reset(self, max_weight=8, prec=1024) -> None:
447447
r"""
448448
Reset the cache to its default values or to given arguments.
449449
@@ -464,7 +464,7 @@ def reset(self, max_weight=8, prec=1024):
464464
self.max_weight = int(max_weight)
465465
self._data = pari.zetamultall(self.max_weight, precision=self.prec)
466466

467-
def update(self, max_weight, prec):
467+
def update(self, max_weight, prec) -> None:
468468
"""
469469
Compute and store more values if needed.
470470
@@ -550,7 +550,7 @@ def __call__(self, index, prec=None, reverse=True):
550550
Values = MultizetaValues()
551551

552552

553-
def extend_multiplicative_basis(B, n) -> Iterator:
553+
def extend_multiplicative_basis(B, n) -> Iterator[tuple]:
554554
"""
555555
Extend a multiplicative basis into a basis.
556556
@@ -647,7 +647,7 @@ class Multizetas(CombinatorialFreeModule):
647647
sage: z
648648
ζ(1,2,3)
649649
"""
650-
def __init__(self, R):
650+
def __init__(self, R) -> None:
651651
"""
652652
TESTS::
653653
@@ -726,7 +726,7 @@ def some_elements(self) -> tuple:
726726
"""
727727
return self([]), self([2]), self([3]), self([4]), self((1, 2))
728728

729-
def an_element(self):
729+
def _an_element_(self):
730730
r"""
731731
Return an element of the algebra.
732732
@@ -1253,7 +1253,7 @@ def _richcmp_(self, other, op) -> bool:
12531253
raise TypeError('invalid comparison for multizetas')
12541254
return self.iterated()._richcmp_(other.iterated(), op)
12551255

1256-
def __hash__(self):
1256+
def __hash__(self) -> int:
12571257
"""
12581258
Return the hash of ``self``.
12591259
@@ -1404,7 +1404,7 @@ class Multizetas_iterated(CombinatorialFreeModule):
14041404
sage: M((1,0))*M((1,0,0))
14051405
6*I(11000) + 3*I(10100) + I(10010)
14061406
"""
1407-
def __init__(self, R):
1407+
def __init__(self, R) -> None:
14081408
"""
14091409
TESTS::
14101410
@@ -2067,7 +2067,7 @@ class All_iterated(CombinatorialFreeModule):
20672067
sage: x.regularise()
20682068
-I(10)
20692069
"""
2070-
def __init__(self, R):
2070+
def __init__(self, R) -> None:
20712071
"""
20722072
TESTS::
20732073

src/sage/modular/multiple_zeta_F_algebra.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class F_algebra(CombinatorialFreeModule):
266266
sage: s = f2*f3+f5; s
267267
f5 + f2*f3
268268
"""
269-
def __init__(self, R, start=3):
269+
def __init__(self, R, start=3) -> None:
270270
r"""
271271
Initialize ``self``.
272272
@@ -460,7 +460,7 @@ def gen(self, i):
460460
B *= ZZ(2)**(3 * i - 1) * ZZ(3)**i / ZZ(2 * i).factorial()
461461
return B * f2**i
462462

463-
def an_element(self):
463+
def _an_element_(self):
464464
"""
465465
Return a typical element.
466466
@@ -473,7 +473,7 @@ def an_element(self):
473473
"""
474474
return self("253") + 3 * self("235")
475475

476-
def some_elements(self):
476+
def some_elements(self) -> list:
477477
"""
478478
Return some typical elements.
479479

0 commit comments

Comments
 (0)