From d7e8910a7f4faed0db928eea4c1897f019fffcaf Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 10 Oct 2024 14:48:19 -0700 Subject: [PATCH] special case osmething --- reflex/utils/pyi_generator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index 74e83ff05..288800233 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -428,11 +428,15 @@ def _generate_component_create_functiondef( kwargs.extend(prop_kwargs) def figure_out_return_type(annotation: Any): + print(annotation) if inspect.isclass(annotation) and issubclass(annotation, inspect._empty): return ast.Name(id="Optional[EventType[[]]]") if isinstance(annotation, str) and annotation.startswith("Tuple["): inside_of_tuple = annotation.removeprefix("Tuple[").removesuffix("]") + if inside_of_tuple == "()": + return ast.Name(id="Optional[EventType[[]]]") + arguments: list[str] = [""] bracket_count = 0