瀏覽代碼

special case ellipsis types

Khaleel Al-Adhami 6 月之前
父節點
當前提交
2c04153013
共有 1 個文件被更改,包括 10 次插入2 次删除
  1. 10 2
      reflex/vars/base.py

+ 10 - 2
reflex/vars/base.py

@@ -14,7 +14,7 @@ import re
 import string
 import string
 import sys
 import sys
 import warnings
 import warnings
-from types import CodeType, EllipsisType, FunctionType
+from types import CodeType, FunctionType
 from typing import (
 from typing import (
     TYPE_CHECKING,
     TYPE_CHECKING,
     Any,
     Any,
@@ -96,9 +96,17 @@ class ReflexCallable(Protocol[P, R]):
     __call__: Callable[P, R]
     __call__: Callable[P, R]
 
 
 
 
+if sys.version_info >= (3, 10):
+    from types import EllipsisType
+
+    ReflexCallableParams = Union[EllipsisType, Tuple[GenericType, ...]]
+else:
+    ReflexCallableParams = Union[Any, Tuple[GenericType, ...]]
+
+
 def unwrap_reflex_callalbe(
 def unwrap_reflex_callalbe(
     callable_type: GenericType,
     callable_type: GenericType,
-) -> Tuple[Union[EllipsisType, Tuple[GenericType, ...]], GenericType]:
+) -> Tuple[ReflexCallableParams, GenericType]:
     """Unwrap the ReflexCallable type.
     """Unwrap the ReflexCallable type.
 
 
     Args:
     Args: