Skip to content

Commit 3520ee2

Browse files
author
Release Manager
committed
gh-40915: some -> bool annotations for is_a* methods mostly about "is_abelian", "is_absolute" and "is_affine" ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: #40915 Reported by: Frédéric Chapoton Reviewer(s): Frédéric Chapoton, Vincent Macri
2 parents 60169d0 + 2dcffba commit 3520ee2

26 files changed

+82
-83
lines changed

src/sage/algebras/lie_algebras/abelian.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _construct_UEA(self):
9898
"""
9999
return PolynomialRing(self.base_ring(), self.variable_names())
100100

101-
def is_abelian(self):
101+
def is_abelian(self) -> bool:
102102
"""
103103
Return ``True`` since ``self`` is an abelian Lie algebra.
104104
@@ -159,7 +159,7 @@ def dimension(self):
159159
"""
160160
return infinity
161161

162-
def is_abelian(self):
162+
def is_abelian(self) -> bool:
163163
"""
164164
Return ``True`` since ``self`` is an abelian Lie algebra.
165165

src/sage/algebras/lie_algebras/free_lie_algebra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def _construct_UEA(self):
206206
"""
207207
return FreeAlgebra(self.base_ring(), len(self._names), self._names)
208208

209-
def is_abelian(self):
209+
def is_abelian(self) -> bool:
210210
"""
211211
Return ``True`` if this is an abelian Lie algebra.
212212

src/sage/algebras/lie_algebras/lie_algebra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ def zero(self):
13291329
"""
13301330
return self.element_class(self, self._assoc.zero())
13311331

1332-
def is_abelian(self):
1332+
def is_abelian(self) -> bool:
13331333
"""
13341334
Return ``True`` if ``self`` is abelian.
13351335

src/sage/categories/affine_weyl_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def succ(pair):
136136
post_process=select_length)
137137

138138
class ElementMethods:
139-
def is_affine_grassmannian(self):
139+
def is_affine_grassmannian(self) -> bool:
140140
"""
141141
Test whether ``self`` is affine Grassmannian.
142142

src/sage/categories/category.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ def __classcontains__(cls, x):
745745
return False
746746
return any(isinstance(cat, cls) for cat in c)
747747

748-
def is_abelian(self):
748+
def is_abelian(self) -> bool:
749749
"""
750750
Return whether this category is abelian.
751751

src/sage/categories/category_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def _latex_(self):
333333

334334

335335
class AbelianCategory(Category):
336-
def is_abelian(self):
336+
def is_abelian(self) -> bool:
337337
"""
338338
Return ``True`` as ``self`` is an abelian category.
339339

src/sage/categories/finite_dimensional_lie_algebras_with_basis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ def hypercenter(self):
15061506
"""
15071507
return self.upper_central_series()[-1]
15081508

1509-
def is_abelian(self):
1509+
def is_abelian(self) -> bool:
15101510
"""
15111511
Return if ``self`` is an abelian Lie algebra.
15121512

src/sage/categories/lie_algebras.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def killing_form(self, x, y):
555555
0
556556
"""
557557

558-
def is_abelian(self):
558+
def is_abelian(self) -> bool:
559559
r"""
560560
Return ``True`` if this Lie algebra is abelian.
561561

src/sage/categories/modules_with_basis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def _call_(self, x):
178178
raise TypeError("%s\nunable to coerce x (=%s) into %s" % (msg, x, self))
179179
return M
180180

181-
def is_abelian(self):
181+
def is_abelian(self) -> bool:
182182
"""
183183
Return whether this category is abelian.
184184

src/sage/categories/vector_spaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class WithBasis(CategoryWithAxiom_over_base_ring):
184184

185185
_call_ = ModulesWithBasis.__dict__["_call_"]
186186

187-
def is_abelian(self):
187+
def is_abelian(self) -> bool:
188188
"""
189189
Return whether this category is abelian.
190190

0 commit comments

Comments
 (0)