Kaynağa Gözat

pyi_generator: handle `Callable[[], None]` annotation for LambdaVar

If the annotation is a list, process it recursively and return a list.
Masen Furer 2 hafta önce
ebeveyn
işleme
9afca530f2
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      reflex/utils/pyi_generator.py

+ 6 - 0
reflex/utils/pyi_generator.py

@@ -221,6 +221,12 @@ def _get_type_hint(
             if ev.__name__ == "Var"
             else value
         )
+    elif isinstance(value, list):
+        res = [
+            _get_type_hint(arg, type_hint_globals, rx_types.is_optional(arg))
+            for arg in value
+        ]
+        return f"[{', '.join(res)}]"
     else:
         res = value.__name__
     if is_optional and not res.startswith("Optional") and not res.endswith("| None"):