Skip to content

Commit

Permalink
mypy: fix errors from pytato typing improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored and inducer committed Nov 13, 2024
1 parent fd59c90 commit 755e39a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arraycontext/impl/pytato/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"""

from collections.abc import Mapping
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, cast

from pytato.array import (
AbstractResultWithNamedArrays,
Expand Down Expand Up @@ -71,7 +71,7 @@ def map_data_wrapper(self, expr: DataWrapper) -> Array:
self.bound_arguments[name] = expr.data
return make_placeholder(
name=name,
shape=tuple(self.rec(s) if isinstance(s, Array) else s
shape=tuple(cast(Array, self.rec(s)) if isinstance(s, Array) else s
for s in expr.shape),
dtype=expr.dtype,
axes=expr.axes,
Expand All @@ -87,7 +87,7 @@ def map_placeholder(self, expr: Placeholder) -> Array:

def _normalize_pt_expr(
expr: DictOfNamedArrays
) -> tuple[AbstractResultWithNamedArrays, Mapping[str, Any]]:
) -> tuple[Array | AbstractResultWithNamedArrays, Mapping[str, Any]]:
"""
Returns ``(normalized_expr, bound_arguments)``. *normalized_expr* is a
normalized form of *expr*, with all instances of
Expand Down

0 comments on commit 755e39a

Please sign in to comment.