special case osmething
This commit is contained in:
parent
e5fdf3897a
commit
d7e8910a7f
@ -428,11 +428,15 @@ def _generate_component_create_functiondef(
|
|||||||
kwargs.extend(prop_kwargs)
|
kwargs.extend(prop_kwargs)
|
||||||
|
|
||||||
def figure_out_return_type(annotation: Any):
|
def figure_out_return_type(annotation: Any):
|
||||||
|
print(annotation)
|
||||||
if inspect.isclass(annotation) and issubclass(annotation, inspect._empty):
|
if inspect.isclass(annotation) and issubclass(annotation, inspect._empty):
|
||||||
return ast.Name(id="Optional[EventType[[]]]")
|
return ast.Name(id="Optional[EventType[[]]]")
|
||||||
if isinstance(annotation, str) and annotation.startswith("Tuple["):
|
if isinstance(annotation, str) and annotation.startswith("Tuple["):
|
||||||
inside_of_tuple = annotation.removeprefix("Tuple[").removesuffix("]")
|
inside_of_tuple = annotation.removeprefix("Tuple[").removesuffix("]")
|
||||||
|
|
||||||
|
if inside_of_tuple == "()":
|
||||||
|
return ast.Name(id="Optional[EventType[[]]]")
|
||||||
|
|
||||||
arguments: list[str] = [""]
|
arguments: list[str] = [""]
|
||||||
|
|
||||||
bracket_count = 0
|
bracket_count = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user