Skip to content
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
16 changes: 8 additions & 8 deletions src/sage/algebras/clifford_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CliffordAlgebraIndices(UniqueRepresentation, Parent):
A facade parent for the indices of Clifford algebra.
Users should not create instances of this class directly.
"""
def __init__(self, Qdim, degree=None):
def __init__(self, Qdim, degree=None) -> None:
r"""
Initialize ``self``.

Expand Down Expand Up @@ -271,7 +271,7 @@ def __iter__(self):
yield FrozenBitset(C)
k += 1

def __contains__(self, elt):
def __contains__(self, elt) -> bool:
r"""
Check containment of ``elt`` in ``self``.

Expand Down Expand Up @@ -503,7 +503,7 @@ def __classcall_private__(cls, Q, names=None):
raise ValueError("the number of variables does not match the number of generators")
return super().__classcall__(cls, Q, names)

def __init__(self, Q, names, category=None):
def __init__(self, Q, names, category=None) -> None:
r"""
Initialize ``self``.

Expand Down Expand Up @@ -1463,7 +1463,7 @@ def __classcall_private__(cls, R, names=None, n=None):
raise ValueError("the number of variables does not match the number of generators")
return super().__classcall__(cls, R, names)

def __init__(self, R, names):
def __init__(self, R, names) -> None:
"""
Initialize ``self``.

Expand Down Expand Up @@ -2124,7 +2124,7 @@ def __classcall__(cls, E, s_coeff):
from sage.sets.family import Family
return super().__classcall__(cls, E, Family(d))

def __init__(self, E, s_coeff):
def __init__(self, E, s_coeff) -> None:
"""
Initialize ``self``.

Expand Down Expand Up @@ -2538,7 +2538,7 @@ class ExteriorAlgebraCoboundary(ExteriorAlgebraDifferential):

- :wikipedia:`Exterior_algebra#Differential_geometry`
"""
def __init__(self, E, s_coeff):
def __init__(self, E, s_coeff) -> None:
"""
Initialize ``self``.

Expand Down Expand Up @@ -2733,7 +2733,7 @@ class ExteriorAlgebraIdeal(Ideal_nc):
sage: xbar * ybar
0
"""
def __init__(self, ring, gens, coerce=True, side='twosided'):
def __init__(self, ring, gens, coerce=True, side='twosided') -> None:
"""
Initialize ``self``.

Expand Down Expand Up @@ -2815,7 +2815,7 @@ def _contains_(self, f):
"""
return not self.reduce(f)

def __richcmp__(self, other, op):
def __richcmp__(self, other, op) -> bool:
"""
Compare ``self`` and ``other``.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class FiniteDimensionalAlgebraIdeal(Ideal_generic):
sage: A.ideal(A([0,1]))
Ideal (e1) of Finite-dimensional algebra of degree 2 over Finite Field of size 3
"""
def __init__(self, A, gens=None, given_by_matrix=False):
def __init__(self, A, gens=None, given_by_matrix=False) -> bool:
"""
EXAMPLES::

Expand Down Expand Up @@ -138,7 +138,7 @@ def _richcmp_(self, other, op):
elif op == op_GE or op == op_GT:
return other.vector_space().is_subspace(self.vector_space())

def __contains__(self, elt):
def __contains__(self, elt) -> bool:
"""
EXAMPLES::

Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/letterplace/letterplace_ideal.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class LetterplaceIdeal(Ideal_nc):
sage: (z*I.0-x*y*z).normal_form(I)
-y*x*z + z*z
"""
def __init__(self, ring, gens, coerce=True, side='twosided'):
def __init__(self, ring, gens, coerce=True, side='twosided') -> None:
"""
INPUT:

Expand Down Expand Up @@ -334,7 +334,7 @@ class LetterplaceIdeal(Ideal_nc):
self.__GB.__uptodeg = degbound
return self.__GB

def __contains__(self, x):
def __contains__(self, x) -> bool:
"""
The containment test is based on a normal form computation.

Expand Down
10 changes: 5 additions & 5 deletions src/sage/algebras/lie_algebras/affine_lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __classcall_private__(cls, arg0, cartan_type=None, kac_moody=True):
return UntwistedAffineLieAlgebra(g, kac_moody=kac_moody)
return TwistedAffineLieAlgebra(arg0, cartan_type, kac_moody=kac_moody)

def __init__(self, g, cartan_type, names, kac_moody):
def __init__(self, g, cartan_type, names, kac_moody) -> None:
"""
Initialize ``self``.

Expand Down Expand Up @@ -578,7 +578,7 @@ class UntwistedAffineLieAlgebra(AffineLieAlgebra):
sage: D.d()
0
"""
def __init__(self, g, kac_moody):
def __init__(self, g, kac_moody) -> None:
"""
Initialize ``self``.

Expand Down Expand Up @@ -671,7 +671,7 @@ class TwistedAffineLieAlgebra(AffineLieAlgebra):
weights in this representation with the roots of type `B_n` and
the double all of its short roots.
"""
def __init__(self, R, cartan_type, kac_moody):
def __init__(self, R, cartan_type, kac_moody) -> None:
"""
Initialize ``self``.

Expand Down Expand Up @@ -1107,7 +1107,7 @@ def __classcall_private__(cls, cartan_type):
raise ValueError("the Cartan type must be a twisted affine type")
return super().__classcall__(cls, cartan_type)

def __init__(self, cartan_type):
def __init__(self, cartan_type) -> None:
"""
Initialize ``self``.

Expand Down Expand Up @@ -1141,7 +1141,7 @@ def __init__(self, cartan_type):
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
super().__init__(facade=facade, category=InfiniteEnumeratedSets())

def __contains__(self, x):
def __contains__(self, x) -> bool:
"""
Return if ``x`` is contained in ``self``.

Expand Down
8 changes: 4 additions & 4 deletions src/sage/algebras/lie_algebras/bgg_dual_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class BGGDualModule(CombinatorialFreeModule):

- [Humphreys08]_
"""
def __init__(self, module):
def __init__(self, module) -> None:
r"""
Initialize ``self``.

Expand Down Expand Up @@ -458,7 +458,7 @@ def __classcall__(cls, simple, prefix='f', **kwds):
"""
return super(IndexedMonoid, cls).__classcall__(cls, simple, prefix=prefix, **kwds)

def __init__(self, simple, prefix, category=None, **kwds):
def __init__(self, simple, prefix, category=None, **kwds) -> None:
r"""
Initialize ``self``.

Expand Down Expand Up @@ -591,7 +591,7 @@ def weight_space_basis(self, mu):
self._construct_next_level()
return self._weight_space_bases.get(mu, [])

def __contains__(self, m):
def __contains__(self, m) -> bool:
r"""
Check if ``m`` is contained in ``self``.

Expand Down Expand Up @@ -815,7 +815,7 @@ def __classcall_private__(cls, g, weight, *args, **kwds):
return FiniteDimensionalSimpleModule(g, weight, *args, **kwds)
return super().__classcall__(cls, g, weight, *args, **kwds)

def __init__(self, g, weight, prefix='f', basis_key=None, **kwds):
def __init__(self, g, weight, prefix='f', basis_key=None, **kwds) -> None:
r"""
Initialize ``self``.

Expand Down
8 changes: 5 additions & 3 deletions src/sage/algebras/lie_algebras/subalgebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ def __classcall_private__(cls, ambient, gens, ideal_of=None,
return super().__classcall__(cls, ambient, gens, ideal_of,
order, category)

def __init__(self, ambient, gens, ideal_of, order=None, category=None):
def __init__(self, ambient, gens, ideal_of,
order=None, category=None) -> None:
r"""
Initialize ``self``.

Expand Down Expand Up @@ -302,7 +303,7 @@ def __init__(self, ambient, gens, ideal_of, order=None, category=None):
f = SetMorphism(H, self.lift)
ambient.register_coercion(f)

def __contains__(self, x):
def __contains__(self, x) -> bool:
r"""
Return ``True`` if ``x`` is an element of ``self``.

Expand Down Expand Up @@ -338,7 +339,8 @@ def __getitem__(self, x):
If `x` is a pair `(a, b)`, return the Lie bracket `[a, b]`.
Otherwise try to return the `x`-th element of ``self``.

This replicates the convenience syntax for Lie brackets of Lie algebras.
This replicates the convenience syntax for Lie brackets
of Lie algebras.

EXAMPLES::

Expand Down
23 changes: 12 additions & 11 deletions src/sage/algebras/quatalg/quaternion_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ class QuaternionAlgebra_ab(QuaternionAlgebra_abstract):
sage: QuaternionAlgebra(QQ, -7, -21) # indirect doctest
Quaternion Algebra (-7, -21) with base ring Rational Field
"""
def __init__(self, base_ring, a, b, names='i,j,k'):
def __init__(self, base_ring, a, b, names='i,j,k') -> None:
"""
Create the quaternion algebra with `i^2 = a`, `j^2 = b`, and
`ij = -ji = k`.
Expand Down Expand Up @@ -1234,7 +1234,7 @@ def invariants(self):
"""
return self._a, self._b

def __eq__(self, other):
def __eq__(self, other) -> bool:
"""
Compare ``self`` and ``other``.

Expand All @@ -1250,7 +1250,7 @@ def __eq__(self, other):
return (self.base_ring() == other.base_ring() and
(self._a, self._b) == (other._a, other._b))

def __ne__(self, other):
def __ne__(self, other) -> bool:
"""
Compare ``self`` and ``other``.

Expand All @@ -1263,7 +1263,7 @@ def __ne__(self, other):
"""
return not self.__eq__(other)

def __hash__(self):
def __hash__(self) -> int:
"""
Compute the hash of ``self``.

Expand Down Expand Up @@ -1985,7 +1985,7 @@ class QuaternionOrder(Parent):
sage: type(QuaternionAlgebra(-1,-7).maximal_order())
<class 'sage.algebras.quatalg.quaternion_algebra.QuaternionOrder_with_category'>
"""
def __init__(self, A, basis, check=True):
def __init__(self, A, basis, check=True) -> None:
"""
INPUT:

Expand Down Expand Up @@ -2186,7 +2186,7 @@ def gen(self, n):
"""
return self.__basis[n]

def __richcmp__(self, other, op):
def __richcmp__(self, other, op) -> bool:
"""
Compare this quaternion order to ``other``.

Expand Down Expand Up @@ -2239,7 +2239,7 @@ def __richcmp__(self, other, op):
return op == op_NE
return richcmp(self.unit_ideal(), other.unit_ideal(), op)

def __hash__(self):
def __hash__(self) -> int:
"""
Compute the hash of ``self``.

Expand Down Expand Up @@ -3013,7 +3013,8 @@ class QuaternionFractionalIdeal_rational(QuaternionFractionalIdeal):
- ``check`` -- boolean (default: ``True``); if ``False``, do no type
checking.
"""
def __init__(self, Q, basis, left_order=None, right_order=None, check=True):
def __init__(self, Q, basis, left_order=None,
right_order=None, check=True) -> None:
"""
EXAMPLES::

Expand Down Expand Up @@ -3267,7 +3268,7 @@ def right_order(self):
self.__right_order = self._compute_order(side='right')
return self.__right_order

def __repr__(self):
def __repr__(self) -> str:
"""
Return string representation of this quaternion fractional ideal.

Expand Down Expand Up @@ -3361,7 +3362,7 @@ def _richcmp_(self, right, op):
"""
return self.free_module().__richcmp__(right.free_module(), op)

def __hash__(self):
def __hash__(self) -> int:
"""
Return the hash of ``self``.

Expand Down Expand Up @@ -4165,7 +4166,7 @@ def is_principal(self, certificate=False):
# find an element of minimal norm in self; see [Piz1980]_, Corollary 1.20.
return True, self.minimal_element()

def __contains__(self, x):
def __contains__(self, x) -> bool:
"""
Return whether ``x`` is in ``self``.

Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/steenrod/steenrod_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,7 @@ def _element_constructor_(self, x):
return a.change_basis(self.basis_name())
raise ValueError("element does not lie in this Steenrod algebra")

def __contains__(self, x):
def __contains__(self, x) -> bool:
r"""
Return ``True`` if ``self`` contains `x`.

Expand Down
4 changes: 2 additions & 2 deletions src/sage/coding/abstract_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class AbstractCode(Parent):
"""

def __init__(self, length, default_encoder_name=None,
default_decoder_name=None, metric='Hamming'):
default_decoder_name=None, metric='Hamming') -> None:
r"""
Initialize mandatory parameters that any code shares.

Expand Down Expand Up @@ -348,7 +348,7 @@ def __iter__(self):
"""
raise RuntimeError("Please override __iter__ in the implementation of {}".format(self.parent()))

def __contains__(self, c):
def __contains__(self, c) -> bool:
r"""
Return an error message requiring to override ``__contains__`` in ``self``.

Expand Down
Loading
Loading