Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ select = [
"RUF013",
"RUF036",

# flake8-builtins
"A003",

"TC", # flake8-type-checking - https://docs.astral.sh/ruff/rules/#flake8-type-checking-tc

# pyupgrade -- https://docs.astral.sh/ruff/rules/#pyupgrade-up
Expand Down
2 changes: 1 addition & 1 deletion src/mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://mypy.readthedocs.io/en/stable/config_file.html
[mypy]
python_version = 3.11
python_version = 3.12

# https://github.com/sagemath/sage/issues/36198#issuecomment-1709521850
follow_imports = skip
Expand Down
14 changes: 4 additions & 10 deletions src/sage/algebras/clifford_algebra_element.pyi
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
import builtins
from typing import Any

class CliffordAlgebraElement:
def _repr_(self) -> str: ...
def _latex_(self) -> str: ...
def _mul_(self, other: CliffordAlgebraElement) -> CliffordAlgebraElement: ...
def _mul_self_term(self, supp: Any, coeff: Any) -> CliffordAlgebraElement: ...
def _mul_term_self(self, supp: Any, coeff: Any) -> CliffordAlgebraElement: ...
def list(self) -> list[tuple[Any, Any]]: ...
def support(self) -> list[Any]: ...
def list(self) -> builtins.list[tuple[Any, Any]]: ...
def support(self) -> builtins.list[Any]: ...
def reflection(self) -> CliffordAlgebraElement: ...
degree_negation = reflection
def transpose(self) -> CliffordAlgebraElement: ...
def conjugate(self) -> CliffordAlgebraElement: ...
clifford_conjugate = conjugate

class ExteriorAlgebraElement(CliffordAlgebraElement):
def _mul_(self, other: ExteriorAlgebraElement) -> ExteriorAlgebraElement: ...
def _mul_self_term(self, supp: Any, coeff: Any) -> ExteriorAlgebraElement: ...
def _mul_term_self(self, supp: Any, coeff: Any) -> ExteriorAlgebraElement: ...
def reduce(self, I: Any, left: bool = True) -> ExteriorAlgebraElement: ...
def interior_product(self, x: Any) -> ExteriorAlgebraElement: ...
antiderivation = interior_product
def hodge_dual(self) -> ExteriorAlgebraElement: ...
def constant_coefficient(self) -> Any: ...
def scalar(self, other: ExteriorAlgebraElement) -> Any: ...

class CohomologyRAAGElement(CliffordAlgebraElement):
def _mul_(self, other: CohomologyRAAGElement) -> CohomologyRAAGElement: ...
class CohomologyRAAGElement(CliffordAlgebraElement): ...
20 changes: 12 additions & 8 deletions src/sage/combinat/posets/posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@
from sage.combinat.combinatorial_map import combinatorial_map
from sage.combinat.subset import Subsets
from .linear_extensions import LinearExtensionsOfPoset
from typing import TYPE_CHECKING

if TYPE_CHECKING:
import builtins


def Poset(data=None, element_labels=None, cover_relations=False, linear_extension=False, category=None, facade=None, key=None):
Expand Down Expand Up @@ -2746,7 +2750,7 @@ def number_of_relations(self):

relations_number = number_of_relations

def linear_intervals_count(self) -> list[int]:
def linear_intervals_count(self) -> builtins.list[int]:
"""
Return the enumeration of linear intervals w.r.t. their cardinality.

Expand Down Expand Up @@ -4156,7 +4160,7 @@ def upper_covers_iterator(self, x):
for e in self._hasse_diagram.neighbor_out_iterator(self._element_to_vertex(x)):
yield self._vertex_to_element(e)

def upper_covers(self, x) -> list:
def upper_covers(self, x) -> builtins.list:
"""
Return the list of upper covers of the element ``x``.

Expand Down Expand Up @@ -4189,7 +4193,7 @@ def lower_covers_iterator(self, x):
for e in self._hasse_diagram.neighbor_in_iterator(self._element_to_vertex(x)):
yield self._vertex_to_element(e)

def lower_covers(self, x) -> list:
def lower_covers(self, x) -> builtins.list:
"""
Return the list of lower covers of the element ``x``.

Expand Down Expand Up @@ -4429,7 +4433,7 @@ def coxeter_polynomial(self, algorithm="sage"):
return dense_matrix.CharacteristicPolynomial().sage()
return cox_matrix.charpoly()

def coxeter_smith_form(self, algorithm='singular') -> list:
def coxeter_smith_form(self, algorithm='singular') -> builtins.list:
"""
Return the Smith normal form of `x` minus the Coxeter transformation
matrix.
Expand Down Expand Up @@ -4743,7 +4747,7 @@ def isomorphic_subposets_iterator(self, other):
raise TypeError("'other' is not a finite poset")
return (self.subposet([self._list[i] for i in x]) for x in self._hasse_diagram.transitive_closure().subgraph_search_iterator(other.hasse_diagram().transitive_closure(), induced=True, return_graphs=False))

def isomorphic_subposets(self, other) -> list:
def isomorphic_subposets(self, other) -> builtins.list:
"""
Return a list of subposets of ``self`` isomorphic to ``other``.

Expand Down Expand Up @@ -5051,7 +5055,7 @@ def chains(self, element_constructor=None, exclude=None):
result.rename("Set of chains of %s" % self)
return result

def connected_components(self) -> list:
def connected_components(self) -> builtins.list:
"""
Return the connected components of the poset as subposets.

Expand Down Expand Up @@ -5098,7 +5102,7 @@ def connected_components(self) -> list:
facade=False))
return result

def ordinal_summands(self) -> list:
def ordinal_summands(self) -> builtins.list:
r"""
Return the ordinal summands of the poset as subposets.

Expand Down Expand Up @@ -5309,7 +5313,7 @@ def covers(pq, ppqq):

return Poset((rees_set, covers), cover_relations=True)

def factor(self) -> list:
def factor(self) -> builtins.list:
"""
Factor the poset as a Cartesian product of smaller posets.

Expand Down
3 changes: 2 additions & 1 deletion src/sage/interfaces/singular.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

import builtins
import os
import platform
import re
Expand Down Expand Up @@ -1221,7 +1222,7 @@ def current_ring(self):
else:
return None

def _tab_completion(self) -> list:
def _tab_completion(self) -> builtins.list[str]:
"""
Return a list of all Singular commands.

Expand Down
Loading
Loading