diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-05-19 19:36:31 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-05-19 20:23:53 +0530 |
commit | 0b9c08b47bb5e95c21b067044ace4e824d19a9c2 (patch) | |
tree | 20a4ad48072bab9fbccc82b6a48ad3fd1174bf0c /yt_dlp/compat/functools.py | |
parent | 2f97cc615bdb788bf5c86c1132144ca491b820c3 (diff) | |
download | hypervideo-pre-0b9c08b47bb5e95c21b067044ace4e824d19a9c2.tar.lz hypervideo-pre-0b9c08b47bb5e95c21b067044ace4e824d19a9c2.tar.xz hypervideo-pre-0b9c08b47bb5e95c21b067044ace4e824d19a9c2.zip |
[utils] Improve performance using `functools.cache`
Closes #3786
Diffstat (limited to 'yt_dlp/compat/functools.py')
-rw-r--r-- | yt_dlp/compat/functools.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/yt_dlp/compat/functools.py b/yt_dlp/compat/functools.py new file mode 100644 index 000000000..36c983642 --- /dev/null +++ b/yt_dlp/compat/functools.py @@ -0,0 +1,12 @@ +# flake8: noqa: F405 +from functools import * # noqa: F403 + +from .compat_utils import passthrough_module + +passthrough_module(__name__, 'functools') +del passthrough_module + +try: + cache # >= 3.9 +except NameError: + cache = lru_cache(maxsize=None) |