From ac281dc9e47dbb3910a17044e7c5dfc131e0c992 Mon Sep 17 00:00:00 2001 From: James Addison Date: Sat, 16 Nov 2024 11:34:34 +0000 Subject: [PATCH] HTML search: typing/lint fixups for `ruff` and `mypy` --- sphinx/search/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sphinx/search/__init__.py b/sphinx/search/__init__.py index 7c1f3b976ae..5bf3bb33986 100644 --- a/sphinx/search/__init__.py +++ b/sphinx/search/__init__.py @@ -168,7 +168,9 @@ class _JavaScriptIndex: SUFFIX = ')' def dumps(self, data: Any) -> str: - json_dump = lambda data: json.dumps(data, separators=(',', ':')) + def json_dump(data: str | tuple | list) -> str: + return json.dumps(data, separators=(',', ':')) + js_indices = { json_dump(name): f'new Map({json_dump(sorted(entries.items()))})' if isinstance(entries, dict)