File tree Expand file tree Collapse file tree 2 files changed +112
-116
lines changed
packages/reflex-base/src/reflex_base/utils Expand file tree Collapse file tree 2 files changed +112
-116
lines changed Original file line number Diff line number Diff line change @@ -627,11 +627,12 @@ def _get_visible_type_name(
627627 if type_hint_globals is None :
628628 return None
629629
630+ type_module = getattr (typ , "__module__" , None )
630631 type_name = getattr (typ , "__name__" , None )
631- if (
632- type_name is not None
633- and type_name in type_hint_globals
634- and type_hint_globals [ type_name ] is typ
632+
633+ if type_name is not None and (
634+ type_hint_globals . get ( type_name ) is typ
635+ or type_name in DEFAULT_IMPORTS . get ( str ( type_module ), set ())
635636 ):
636637 return type_name
637638
@@ -686,11 +687,6 @@ def type_to_ast(
686687 return ast .Name (id = typ .__name__ )
687688 if visible_name := _get_visible_type_name (typ , type_hint_globals ):
688689 return ast .Name (id = visible_name )
689- if (
690- typ .__module__ in DEFAULT_IMPORTS
691- and typ .__name__ in DEFAULT_IMPORTS [typ .__module__ ]
692- ):
693- return ast .Name (id = typ .__name__ )
694690 return ast .Name (id = typ .__module__ + "." + typ .__name__ )
695691 return ast .Name (id = typ .__name__ )
696692 if hasattr (typ , "_name" ):
You can’t perform that action at this time.
0 commit comments