Skip to content

Commit e29ce59

Browse files
Merge branch 'main' into schnellerhase/fix-some-types
2 parents 3e69540 + 6838357 commit e29ce59

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

python/basix/finite_element.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""Functions for creating finite elements."""
77

88
from collections.abc import Sequence
9-
from typing import TYPE_CHECKING, Generic, TypeVar
9+
from typing import TYPE_CHECKING, Generic, TypeVar, Self
1010
from warnings import warn
1111

1212
import numpy as np
@@ -298,7 +298,7 @@ def entity_transformations(self) -> dict:
298298
"""
299299
return self._e.entity_transformations()
300300

301-
def get_tensor_product_representation(self) -> list[list["FiniteElement"]]:
301+
def get_tensor_product_representation(self) -> list[list[Self]]:
302302
"""Get the tensor product representation of this element.
303303
304304
Raises an exception if no such factorisation exists.
@@ -315,7 +315,7 @@ def get_tensor_product_representation(self) -> list[list["FiniteElement"]]:
315315
The tensor product representation
316316
"""
317317
factors = self._e.get_tensor_product_representation()
318-
return [[FiniteElement(e) for e in elements] for elements in factors]
318+
return [[type(self)(e) for e in elements] for elements in factors]
319319

320320
def permute_subentity_closure(
321321
self,

0 commit comments

Comments
 (0)