mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-05 04:38:26 +00:00
core[patch]: add caching to get_function_nonlocals (#28131)
This commit is contained in:
parent
74438f3ae8
commit
ed4952e475
@ -388,6 +388,7 @@ def get_lambda_source(func: Callable) -> Optional[str]:
|
||||
return name
|
||||
|
||||
|
||||
@lru_cache(maxsize=256)
|
||||
def get_function_nonlocals(func: Callable) -> list[Any]:
|
||||
"""Get the nonlocal variables accessed by a function.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user