浏览代码

add __code__ to protect against event callbacks from being interpreted as lambda events

Khaleel Al-Adhami 1 周之前
父节点
当前提交
e196f7233b
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      reflex/event.py

+ 2 - 0
reflex/event.py

@@ -2017,6 +2017,8 @@ class EventCallback(Generic[Unpack[P]], EventActionsMixin):
 class LambdaEventCallback(Protocol[Unpack[P]]):
     """A protocol for a lambda event callback."""
 
+    __code__: types.CodeType
+
     @overload
     def __call__(self: LambdaEventCallback[()]) -> Any: ...