Skip to content

Commit a571c28

Browse files
committed
fix type hints
1 parent d483dc0 commit a571c28

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/reactpy/core/events.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import contextlib
55
import inspect
66
from collections.abc import Sequence
7-
from typing import Any, Callable, Literal, overload
7+
from typing import Any, Callable, Literal, cast, overload
88

99
from anyio import create_task_group
1010

@@ -119,7 +119,7 @@ def __init__(
119119

120120
if not (stop_propagation and prevent_default):
121121
with contextlib.suppress(Exception):
122-
func_to_inspect = function
122+
func_to_inspect = cast(Any, function)
123123
while hasattr(func_to_inspect, "__wrapped__"):
124124
func_to_inspect = func_to_inspect.__wrapped__
125125

@@ -172,21 +172,21 @@ def to_event_handler_function(
172172
async def wrapper(data: Sequence[Any]) -> None:
173173
await function(*data)
174174

175-
wrapper.__wrapped__ = function
175+
cast(Any, wrapper).__wrapped__ = function
176176

177177
else:
178178

179179
async def wrapper(data: Sequence[Any]) -> None:
180180
function(*data)
181181

182-
wrapper.__wrapped__ = function
182+
cast(Any, wrapper).__wrapped__ = function
183183
return wrapper
184184
elif not asyncio.iscoroutinefunction(function):
185185

186186
async def wrapper(data: Sequence[Any]) -> None:
187187
function(data)
188188

189-
wrapper.__wrapped__ = function
189+
cast(Any, wrapper).__wrapped__ = function
190190
return wrapper
191191
else:
192192
return function

0 commit comments

Comments
 (0)