diff --git a/pymbolic/mapper/substitutor.py b/pymbolic/mapper/substitutor.py index 2194c1cf16d2b9f03614a0d030a278172ee89522..b584d0d74a43a045d37414b420f8ac7bf9bf0f9d 100644 --- a/pymbolic/mapper/substitutor.py +++ b/pymbolic/mapper/substitutor.py @@ -39,15 +39,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ from collections.abc import Callable -from typing import Any - -from useful_types import SupportsGetItem, SupportsItems +from typing import TYPE_CHECKING, Any from pymbolic.mapper import CachedIdentityMapper, IdentityMapper from pymbolic.primitives import AlgebraicLeaf from pymbolic.typing import ExpressionT +if TYPE_CHECKING: + from useful_types import SupportsGetItem, SupportsItems + + class SubstitutionMapper(IdentityMapper[[]]): def __init__( self, subst_func: Callable[[AlgebraicLeaf], ExpressionT | None]