Skip to content

Commit 936a403

Browse files
committed
fixing ruff UP037 (about type annotation)
1 parent 30b3d78 commit 936a403

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/sage/manifolds/differentiable/tensorfield.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ def __init__(
476476
self._vmodule = vector_field_module
477477
self._tensor_type = tuple(tensor_type)
478478
self._tensor_rank = self._tensor_type[0] + self._tensor_type[1]
479-
self._is_zero = False # a priori, may be changed below or via
480-
# method __bool__()
479+
self._is_zero = False
480+
# a priori, may be changed below or via method __bool__()
481+
481482
self._name = name
482483
if latex_name is None:
483484
self._latex_name = self._name
@@ -503,7 +504,7 @@ def __init__(
503504
# Initialization of derived quantities:
504505
self._init_derived()
505506

506-
####### Required methods for ModuleElement (beside arithmetic) #######
507+
# ###### Required methods for ModuleElement (beside arithmetic) #######
507508

508509
def __bool__(self):
509510
r"""
@@ -547,7 +548,7 @@ def __bool__(self):
547548
self._is_zero = True
548549
return False
549550

550-
##### End of required methods for ModuleElement (beside arithmetic) #####
551+
# #### End of required methods for ModuleElement (beside arithmetic) #####
551552

552553
def _repr_(self):
553554
r"""
@@ -3742,7 +3743,7 @@ def up(
37423743
self,
37433744
non_degenerate_form: Union[PseudoRiemannianMetric, SymplecticForm, PoissonTensorField],
37443745
pos: Optional[int] = None,
3745-
) -> "TensorField":
3746+
) -> TensorField:
37463747
r"""
37473748
Compute a dual of the tensor field by raising some index with the
37483749
given tensor field (usually, a pseudo-Riemannian metric, a symplectic form or a Poisson tensor).

src/sage/modular/etaproducts.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def __invert__(self):
183183
P = self.parent()
184184
return P.element_class(P, newdict)
185185

186-
def is_one(self):
186+
def is_one(self) -> bool:
187187
r"""
188188
Return whether ``self`` is the one of the monoid.
189189
@@ -323,7 +323,7 @@ def qexp(self, n):
323323
"""
324324
return self.q_expansion(n)
325325

326-
def order_at_cusp(self, cusp: 'CuspFamily') -> Integer:
326+
def order_at_cusp(self, cusp: CuspFamily) -> Integer:
327327
r"""
328328
Return the order of vanishing of ``self`` at the given cusp.
329329
@@ -492,7 +492,7 @@ def level(self) -> Integer:
492492
"""
493493
return self._N
494494

495-
def basis(self, reduce=True):
495+
def basis(self, reduce=True) -> list:
496496
r"""
497497
Produce a basis for the free abelian group of eta-products of level
498498
N (under multiplication), attempting to find basis vectors of the
@@ -570,7 +570,7 @@ def basis(self, reduce=True):
570570
else:
571571
return [self(d) for d in dicts]
572572

573-
def reduce_basis(self, long_etas):
573+
def reduce_basis(self, long_etas) -> list:
574574
r"""
575575
Produce a more manageable basis via LLL-reduction.
576576
@@ -693,7 +693,7 @@ def num_cusps_of_width(N, d) -> Integer:
693693
return euler_phi(d.gcd(N // d))
694694

695695

696-
def AllCusps(N):
696+
def AllCusps(N) -> list:
697697
r"""
698698
Return a list of CuspFamily objects corresponding to the cusps of
699699
`X_0(N)`.

0 commit comments

Comments
 (0)