摘要: lru_cache import functools, time @functools.lru_cache(maxsize=128, typed=False) def b(x, y, z=3): time.sleep(2) return x + y print(b(5, 6)) print('~' 阅读全文
posted @ 2022-02-27 23:40 ascertain 阅读(40) 评论(0) 推荐(0) 编辑
摘要: import inspect def b(x, y: int = 5, *args, z, t=55, **kwargs) -> int: return x + y signature = inspect.signature(b) print(signature) print(signature.p 阅读全文
posted @ 2022-02-27 21:32 ascertain 阅读(89) 评论(0) 推荐(0) 编辑