mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 06:53:16 +00:00
core[patch]: add caching to get_function_nonlocals (#28131)
This commit is contained in:
@@ -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.
|
||||
|
||||
|
Reference in New Issue
Block a user