Skip to content

Commit a289d2f

Browse files
committed
Typing fixes
1 parent 5ae36fa commit a289d2f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

shinywidgets/_serialization.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ def json_default(obj: object) -> object:
3434
return b2a_base64(obj).decode("ascii")
3535

3636
if isinstance(obj, Iterable):
37-
return list(obj)
37+
return list(
38+
obj # pyright: ignore[reportUnknownVariableType, reportUnknownArgumentType]
39+
)
3840

3941
if isinstance(obj, numbers.Integral):
4042
return int(obj)

shinywidgets/_shinywidgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def _restore_state():
159159
IPyWidgetRenderFuncAsync = Callable[[], Awaitable[Widget]]
160160

161161

162-
class IPyWidget(RenderFunction):
162+
class IPyWidget(RenderFunction[Widget, object]):
163163
def __init__(self, fn: IPyWidgetRenderFunc) -> None:
164164
super().__init__(fn)
165165
self._fn: IPyWidgetRenderFuncAsync = wrap_async(fn)
@@ -175,7 +175,7 @@ async def run(self) -> object:
175175
return {"model_id": widget.model_id} # type: ignore
176176

177177

178-
class IPyWidgetAsync(IPyWidget, RenderFunctionAsync):
178+
class IPyWidgetAsync(IPyWidget, RenderFunctionAsync[Widget, object]):
179179
def __init__(self, fn: IPyWidgetRenderFuncAsync) -> None:
180180
if not inspect.iscoroutinefunction(fn):
181181
raise TypeError("IPyWidgetAsync requires an async function")

0 commit comments

Comments
 (0)