Skip to content

Commit

Permalink
Remove Self (not supported pre Python 3.11 without adding a dependency)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Jun 29, 2023
1 parent b8b78be commit 86a2140
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ufl/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
from ufl.core.ufl_type import UFLObject
from abc import abstractmethod

from typing import Self

__all_classes__ = ["AbstractCell", "Cell", "TensorProductCell"]


Expand All @@ -39,7 +37,7 @@ def has_simplex_facets(self) -> bool:
"""Return True if all the facets of this cell are simplex cells."""

@abstractmethod
def _lt(self, other: Self) -> bool:
def _lt(self, other) -> bool:
"""Define an arbitrarily chosen but fixed sort order for all instances of this type with the same dimensions."""

@abstractmethod
Expand Down Expand Up @@ -271,7 +269,7 @@ def sub_entity_types(self, dim: int) -> typing.Tuple[AbstractCell, ...]:
except IndexError:
return ()

def _lt(self, other: Self) -> bool:
def _lt(self, other) -> bool:
return self._cellname < other._cellname

def cellname(self) -> str:
Expand Down Expand Up @@ -380,7 +378,7 @@ def sub_entity_types(self, dim: int) -> typing.Tuple[AbstractCell, ...]:
return [self]
raise NotImplementedError(f"TensorProductCell.sub_entities({dim}) is not implemented.")

def _lt(self, other: Self) -> bool:
def _lt(self, other) -> bool:
return self._ufl_hash_data_() < other._ufl_hash_data_()

def cellname(self) -> str:
Expand Down

0 comments on commit 86a2140

Please sign in to comment.