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

Remove typing_extensions #177

Closed
wants to merge 2 commits into from
Closed
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
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ setup_requires =
wheel
install_requires =
numpy
typing_extensions; python_version < "3.11"

[options.extras_require]
docs = sphinx; sphinx_rtd_theme
Expand Down
13 changes: 3 additions & 10 deletions ufl/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
from ufl.core.ufl_type import UFLObject
from abc import abstractmethod

try:
from typing import Self
except ImportError:
# This alternative is needed pre Python 3.11
# Delete this after 04 Oct 2026 (Python 3.10 end of life)
from typing_extensions import Self

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


Expand All @@ -44,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 @@ -276,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 @@ -385,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