From 2182c750dbd6cb1243a84b92e4904b0d3a193c47 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Tue, 2 Dec 2025 08:47:47 +0100 Subject: [PATCH] [ty] Use generator over list comprehension to avoid cast (#21748) --- scripts/ty_benchmark/src/benchmark/lsp_client.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/ty_benchmark/src/benchmark/lsp_client.py b/scripts/ty_benchmark/src/benchmark/lsp_client.py index bd932e667d..d51f61fa09 100644 --- a/scripts/ty_benchmark/src/benchmark/lsp_client.py +++ b/scripts/ty_benchmark/src/benchmark/lsp_client.py @@ -4,7 +4,7 @@ import asyncio import logging from asyncio import Future from pathlib import Path -from typing import Any, NamedTuple, cast, override +from typing import Any, NamedTuple, override from lsprotocol import types as lsp from pygls.lsp.client import LanguageClient @@ -136,12 +136,7 @@ class LSPClient(LanguageClient): self, files: list[Path] ) -> list[FileDiagnostics]: responses = await asyncio.gather( - *[self.text_document_diagnostics_async(f) for f in files] - ) - - responses = cast( - list[lsp.Diagnostic], - responses, + *(self.text_document_diagnostics_async(f) for f in files) ) return [