From b51dae6cc339a3ffddd4894f7b8c4c3462cc731a Mon Sep 17 00:00:00 2001 From: Gordon Watts Date: Thu, 12 Sep 2024 14:46:10 -0700 Subject: [PATCH] Added the dummy function for `len` for type checking --- func_adl/type_based_replacement.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/func_adl/type_based_replacement.py b/func_adl/type_based_replacement.py index cfc7563..e8d94e5 100644 --- a/func_adl/type_based_replacement.py +++ b/func_adl/type_based_replacement.py @@ -61,8 +61,10 @@ def _load_default_global_functions(): # TODO: Add in other functions def my_abs(x: float) -> float: ... # noqa + def my_len(x: Iterable) -> int: ... # noqa _global_functions["abs"] = _FuncAdlFunction("abs", my_abs, None) + _global_functions["len"] = _FuncAdlFunction("len", my_len, None) _load_default_global_functions()