Skip to content

Commit fab073b

Browse files
committed
Un-type symbolic.flatten
This restores compatibility with pymbolic 2022.2 x-ref: firedrakeproject/loopy#27
1 parent 7ac9fa6 commit fab073b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

loopy/symbolic.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import pymbolic.primitives as p
5050
import pytools.lex
5151
from islpy import dim_type
52-
from pymbolic import ArithmeticExpressionT
5352
from pymbolic.mapper import (
5453
CachedCombineMapper as CombineMapperBase,
5554
CachedIdentityMapper as IdentityMapperBase,
@@ -211,14 +210,8 @@ class FlattenMapper(FlattenMapperBase, IdentityMapperMixin):
211210
pass
212211

213212

214-
ArithmeticOrExpressionT = TypeVar(
215-
"ArithmeticOrExpressionT",
216-
ArithmeticExpressionT,
217-
ExpressionT)
218-
219-
220-
def flatten(expr: ArithmeticOrExpressionT) -> ArithmeticOrExpressionT:
221-
return cast(ArithmeticOrExpressionT, FlattenMapper()(expr))
213+
def flatten(expr):
214+
return FlattenMapper()(expr)
222215

223216

224217
class IdentityMapper(IdentityMapperBase, IdentityMapperMixin):

0 commit comments

Comments
 (0)