From 6e376a3eb32f998addfbbbcd7199c8505961100f Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Fri, 8 Mar 2024 19:53:29 +0100 Subject: [PATCH] fix: typing for modules in autorouting --- solara/autorouting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solara/autorouting.py b/solara/autorouting.py index a9d630c41..e17cb62be 100644 --- a/solara/autorouting.py +++ b/solara/autorouting.py @@ -7,7 +7,7 @@ import warnings from pathlib import Path from types import ModuleType -from typing import Any, Callable, List, Optional, cast +from typing import Any, Callable, Dict, List, Optional, cast import ipywidgets import reacton @@ -126,7 +126,7 @@ def RenderPage(main_name: str = "Page"): level_start = solara.use_route_level() router = solara.use_context(solara.routing.router_context) # we use these to cache script runs that use regular ipywidgets - modules = solara.use_memo(dict, dependencies=[]) + modules = cast(Dict[str, ModuleType], solara.use_memo(dict, dependencies=[])) modules_modified_times = solara.use_memo(dict, dependencies=[]) if len(router.path_routes) <= level_start: