Skip to content

Commit 6feede6

Browse files
committed
fix mypy errs
1 parent 05191f3 commit 6feede6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

mypy/constant_fold.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def constant_fold_unary_op(op: str, value: ConstantValue) -> int | float | None:
194194
return None
195195

196196

197-
foldable_builtins = {
197+
foldable_builtins: dict[str, Callable[..., Any] = {
198198
"builtins.str": str,
199199
"builtins.int": int,
200200
"builtins.bool": bool,
@@ -235,8 +235,8 @@ def constant_fold_call_expr(
235235
return None
236236
args.append(arg)
237237

238-
call_args = []
239-
call_kwargs = {}
238+
call_args: list[ConstantValue] = []
239+
call_kwargs: dict[str, ConstantValue] = {}
240240
for folded_arg, arg_kind, arg_name in zip(args, expr.arg_kinds, expr.arg_names):
241241
try:
242242
if arg_kind == ArgKind.ARG_POS:
@@ -251,7 +251,7 @@ def constant_fold_call_expr(
251251
return None
252252

253253
try:
254-
return func(*call_args, **call_kwargs)
254+
return func(*call_args, **call_kwargs) # type: ignore [return-value]
255255
except:
256256
return None
257257
# --- f-string requires partial support for both str.join and str.format ---
@@ -280,3 +280,5 @@ def constant_fold_call_expr(
280280
return None
281281
folded_args.append(arg_val)
282282
return folded_callee.format(*folded_args)
283+
return None
284+

0 commit comments

Comments
 (0)