fix optional wrapping of static call methods in pyi (#4727)
This commit is contained in:
parent
68547dce4c
commit
15da4e17bd
@ -151,7 +151,7 @@ def default_backend_exception_handler(exception: Exception) -> EventSpec:
|
|||||||
position="top-center",
|
position="top-center",
|
||||||
id="backend_error",
|
id="backend_error",
|
||||||
style={"width": "500px"},
|
style={"width": "500px"},
|
||||||
) # pyright: ignore [reportReturnType]
|
)
|
||||||
else:
|
else:
|
||||||
error_message.insert(0, "An error occurred.")
|
error_message.insert(0, "An error occurred.")
|
||||||
return window_alert("\n".join(error_message))
|
return window_alert("\n".join(error_message))
|
||||||
|
@ -177,7 +177,7 @@ class ToastNamespace(ComponentNamespace):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __call__(
|
def __call__(
|
||||||
message: Union[str, Var] = "", level: Optional[str] = None, **props
|
message: Union[str, Var] = "", level: Optional[str] = None, **props
|
||||||
) -> "Optional[EventSpec]":
|
) -> "EventSpec":
|
||||||
"""Send a toast message.
|
"""Send a toast message.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -699,6 +699,7 @@ def _generate_staticmethod_call_functiondef(
|
|||||||
value=_get_type_hint(
|
value=_get_type_hint(
|
||||||
typing.get_type_hints(clz.__call__).get("return", None),
|
typing.get_type_hints(clz.__call__).get("return", None),
|
||||||
type_hint_globals,
|
type_hint_globals,
|
||||||
|
is_optional=False,
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -1623,7 +1623,7 @@ async def test_state_with_invalid_yield(capsys, mock_app):
|
|||||||
id="backend_error",
|
id="backend_error",
|
||||||
position="top-center",
|
position="top-center",
|
||||||
style={"width": "500px"},
|
style={"width": "500px"},
|
||||||
) # pyright: ignore [reportCallIssue, reportArgumentType]
|
)
|
||||||
],
|
],
|
||||||
token="",
|
token="",
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user