Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing ruff UP037 (about type annotation) #37333

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/sage/manifolds/differentiable/tensorfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,9 @@ def __init__(
self._vmodule = vector_field_module
self._tensor_type = tuple(tensor_type)
self._tensor_rank = self._tensor_type[0] + self._tensor_type[1]
self._is_zero = False # a priori, may be changed below or via
# method __bool__()
self._is_zero = False
# a priori, may be changed below or via method __bool__()

self._name = name
if latex_name is None:
self._latex_name = self._name
Expand All @@ -503,7 +504,7 @@ def __init__(
# Initialization of derived quantities:
self._init_derived()

####### Required methods for ModuleElement (beside arithmetic) #######
# ###### Required methods for ModuleElement (beside arithmetic) #######

def __bool__(self):
r"""
Expand Down Expand Up @@ -547,7 +548,7 @@ def __bool__(self):
self._is_zero = True
return False

##### End of required methods for ModuleElement (beside arithmetic) #####
# #### End of required methods for ModuleElement (beside arithmetic) #####

def _repr_(self):
r"""
Expand Down Expand Up @@ -3742,7 +3743,7 @@ def up(
self,
non_degenerate_form: Union[PseudoRiemannianMetric, SymplecticForm, PoissonTensorField],
pos: Optional[int] = None,
) -> "TensorField":
) -> TensorField:
r"""
Compute a dual of the tensor field by raising some index with the
given tensor field (usually, a pseudo-Riemannian metric, a symplectic form or a Poisson tensor).
Expand Down
10 changes: 5 additions & 5 deletions src/sage/modular/etaproducts.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def __invert__(self):
P = self.parent()
return P.element_class(P, newdict)

def is_one(self):
def is_one(self) -> bool:
r"""
Return whether ``self`` is the one of the monoid.

Expand Down Expand Up @@ -323,7 +323,7 @@ def qexp(self, n):
"""
return self.q_expansion(n)

def order_at_cusp(self, cusp: 'CuspFamily') -> Integer:
def order_at_cusp(self, cusp: CuspFamily) -> Integer:
r"""
Return the order of vanishing of ``self`` at the given cusp.

Expand Down Expand Up @@ -492,7 +492,7 @@ def level(self) -> Integer:
"""
return self._N

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

def reduce_basis(self, long_etas):
def reduce_basis(self, long_etas) -> list:
r"""
Produce a more manageable basis via LLL-reduction.

Expand Down Expand Up @@ -693,7 +693,7 @@ def num_cusps_of_width(N, d) -> Integer:
return euler_phi(d.gcd(N // d))


def AllCusps(N):
def AllCusps(N) -> list:
r"""
Return a list of CuspFamily objects corresponding to the cusps of
`X_0(N)`.
Expand Down
Loading