Skip to content

Commit b009509

Browse files
alexfiklinducer
authored andcommitted
primitives: ignore mypy errors
1 parent 62ccdb5 commit b009509

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pytential/symbolic/primitives.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ class NumReferenceDerivative(DiscretizationProperty):
558558
def __new__(cls,
559559
ref_axes: int | tuple[tuple[int, int], ...] | None = None,
560560
operand: Operand | None = None,
561-
dofdesc: DOFDescriptor | None = None) -> "NumReferenceDerivative":
561+
dofdesc: DOFDescriptor | None = None,
562+
) -> "NumReferenceDerivative":
562563
# If the constructor is handed a multivector object, return an
563564
# object array of the operator applied to each of the
564565
# coefficients in the multivector.
@@ -567,7 +568,9 @@ def __new__(cls,
567568
def make_op(operand_i):
568569
return cls(ref_axes, operand_i, as_dofdesc(dofdesc))
569570

570-
return componentwise(make_op, operand)
571+
# FIXME: mypy is right: new should return `cls` instances and we're
572+
# abusing it to vectorize the call like this.
573+
return componentwise(make_op, operand) # type: ignore[return-value]
571574
else:
572575
return DiscretizationProperty.__new__(cls)
573576

@@ -1140,7 +1143,7 @@ def __new__(cls,
11401143
def make_op(operand_i):
11411144
return cls(from_dd, to_dd, operand_i)
11421145

1143-
return componentwise(make_op, operand)
1146+
return componentwise(make_op, operand) # type: ignore[return-value]
11441147
else:
11451148
return Expression.__new__(cls)
11461149

@@ -1185,7 +1188,7 @@ def __new__(cls,
11851188
def make_op(operand_i):
11861189
return cls(operand_i)
11871190

1188-
return componentwise(make_op, operand)
1191+
return componentwise(make_op, operand) # type: ignore[return-value]
11891192
else:
11901193
return Expression.__new__(cls)
11911194

@@ -1248,7 +1251,7 @@ def __new__(cls,
12481251
def make_op(operand_i):
12491252
return cls(operand_i, as_dofdesc(dofdesc))
12501253

1251-
return componentwise(make_op, operand)
1254+
return componentwise(make_op, operand) # type: ignore[return-value]
12521255
else:
12531256
return Expression.__new__(cls)
12541257

0 commit comments

Comments
 (0)