special case osmething

This commit is contained in:
Khaleel Al-Adhami 2024-10-10 14:48:19 -07:00
parent e5fdf3897a
commit d7e8910a7f

View File

@ -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