From 044d2cb0651087de525468289a105f405350d25f Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 22 Jul 2026 21:12:06 +0200 Subject: [PATCH] util: Remove redundant cast in run_curl_into The cast to 'T' in run_curl_into was redundant: mypy already narrows the return value of json.loads() to type T after the isinstance(ret, expected_type) check (where expected_type: type[T]). Remove the unnecessary cast and clean up the unused 'cast' import. This satisfies the new warn_redundant_casts mypy rule. Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1 Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/jw/pkg/lib/util.py b/src/python/jw/pkg/lib/util.py index 3390b58b..c3f581b9 100644 --- a/src/python/jw/pkg/lib/util.py +++ b/src/python/jw/pkg/lib/util.py @@ -5,7 +5,7 @@ import os import sys from enum import Enum, auto -from typing import TYPE_CHECKING, Iterable, TypeVar, cast +from typing import TYPE_CHECKING, Iterable, TypeVar from .base import Input, InputMode, Result from .log import DEBUG, ERR, log @@ -93,7 +93,7 @@ async def run_curl_into( raise TypeError( f'Expected {expected_type.__name__}, got {type(ret).__name__} from Curl' ) - return cast('T', ret) + return ret async def run_askpass( askpass_env: list[str],