@@ -1013,7 +1013,7 @@ def _register_widget(
10131013 widget_type : WidgetRef | None = None ,
10141014 ** options : Any ,
10151015 ) -> WidgetTuple | None :
1016- _options = cast (dict , options )
1016+ _options = cast (" dict" , options )
10171017
10181018 previous_widget = self ._type_defs .get (resolved_type )
10191019
@@ -1074,7 +1074,9 @@ def inner_func(func: Callable) -> widgets.FunctionGui | MagicFactory:
10741074 )
10751075 # MagicFactory is unnecessary if we are immediately instantiating the
10761076 # widget, so we shortcut that and just return the FunctionGui here.
1077- return cast (widgets .FunctionGui , magic_class (func , type_map = self , ** kwargs ))
1077+ return cast (
1078+ "widgets.FunctionGui" , magic_class (func , type_map = self , ** kwargs )
1079+ )
10781080
10791081 return inner_func if function is None else inner_func (function )
10801082
@@ -1160,7 +1162,7 @@ def _import_wdg_class(class_name: str) -> WidgetClass:
11601162
11611163 mod_name , name = class_name .rsplit ("." , 1 )
11621164 mod = importlib .import_module (mod_name )
1163- return cast (WidgetClass , getattr (mod , name ))
1165+ return cast (" WidgetClass" , getattr (mod , name ))
11641166
11651167
11661168def _validate_return_callback (func : Callable ) -> None :
@@ -1176,4 +1178,4 @@ def _generate_union_variants(type_: Any) -> Iterator[type]:
11761178 type_args = get_args (type_ )
11771179 for i in range (2 , len (type_args ) + 1 ):
11781180 for per in itertools .combinations (type_args , i ):
1179- yield cast (type , Union [per ])
1181+ yield cast (" type" , Union [per ])
0 commit comments