From 1ce328e8a9f5229e7722819f0316546b66236920 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 5 Feb 2021 21:02:53 -0300 Subject: [PATCH] cache signature inspection --- lbry/wallet/rpc/util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lbry/wallet/rpc/util.py b/lbry/wallet/rpc/util.py index 1fb743de3..4d461ec69 100644 --- a/lbry/wallet/rpc/util.py +++ b/lbry/wallet/rpc/util.py @@ -32,10 +32,13 @@ import inspect # other_params: None means cannot be called with keyword arguments only # any means any name is good +from functools import lru_cache + SignatureInfo = namedtuple('SignatureInfo', 'min_args max_args ' 'required_names other_names') +@lru_cache(256) def signature_info(func): params = inspect.signature(func).parameters min_args = max_args = 0