Skip to content

Commit 95b98fe

Browse files
authored
Cache duplicate query_object calls (#388)
1 parent 2e7d4c6 commit 95b98fe

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

add_to_pydotorg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import subprocess
3131
import sys
3232
from collections.abc import Generator
33+
from functools import cache
3334
from os import path
3435
from typing import Any, NoReturn
3536

@@ -293,6 +294,7 @@ def list_files(
293294
continue
294295

295296

297+
@cache
296298
def query_object(base_url: str, objtype: str, **params: Any) -> int:
297299
"""Find an API object by query parameters."""
298300
uri = base_url + f"downloads/{objtype}/"

0 commit comments

Comments
 (0)