Skip to content

Commit e6244cd

Browse files
committed
Use typing.Self
1 parent 3c43cde commit e6244cd

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
@@ -5,7 +5,7 @@
55
# SPDX-License-Identifier: MIT
66
"""Functions for creating finite elements."""
77

8-
from typing import TYPE_CHECKING
8+
from typing import TYPE_CHECKING, Self
99
from warnings import warn
1010

1111
import numpy as np
@@ -295,7 +295,7 @@ def entity_transformations(self) -> dict:
295295
"""
296296
return self._e.entity_transformations()
297297

298-
def get_tensor_product_representation(self) -> list[list["FiniteElement"]]:
298+
def get_tensor_product_representation(self) -> list[list[Self]]:
299299
"""Get the tensor product representation of this element.
300300
301301
Raises an exception if no such factorisation exists.
@@ -312,7 +312,7 @@ def get_tensor_product_representation(self) -> list[list["FiniteElement"]]:
312312
The tensor product representation
313313
"""
314314
factors = self._e.get_tensor_product_representation()
315-
return [[FiniteElement(e) for e in elements] for elements in factors]
315+
return [[type(self)(e) for e in elements] for elements in factors]
316316

317317
def permute_subentity_closure(
318318
self,

0 commit comments

Comments
 (0)