@@ -1013,7 +1013,7 @@ def _register_widget(
1013
1013
widget_type : WidgetRef | None = None ,
1014
1014
** options : Any ,
1015
1015
) -> WidgetTuple | None :
1016
- _options = cast (dict , options )
1016
+ _options = cast (" dict" , options )
1017
1017
1018
1018
previous_widget = self ._type_defs .get (resolved_type )
1019
1019
@@ -1074,7 +1074,9 @@ def inner_func(func: Callable) -> widgets.FunctionGui | MagicFactory:
1074
1074
)
1075
1075
# MagicFactory is unnecessary if we are immediately instantiating the
1076
1076
# 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
+ )
1078
1080
1079
1081
return inner_func if function is None else inner_func (function )
1080
1082
@@ -1160,7 +1162,7 @@ def _import_wdg_class(class_name: str) -> WidgetClass:
1160
1162
1161
1163
mod_name , name = class_name .rsplit ("." , 1 )
1162
1164
mod = importlib .import_module (mod_name )
1163
- return cast (WidgetClass , getattr (mod , name ))
1165
+ return cast (" WidgetClass" , getattr (mod , name ))
1164
1166
1165
1167
1166
1168
def _validate_return_callback (func : Callable ) -> None :
@@ -1176,4 +1178,4 @@ def _generate_union_variants(type_: Any) -> Iterator[type]:
1176
1178
type_args = get_args (type_ )
1177
1179
for i in range (2 , len (type_args ) + 1 ):
1178
1180
for per in itertools .combinations (type_args , i ):
1179
- yield cast (type , Union [per ])
1181
+ yield cast (" type" , Union [per ])
0 commit comments