Skip to content

Commit 830c66f

Browse files
committed
chore(gapic): use functools.cache instead of lru_cache in wrappers.py
1 parent 0eb3b09 commit 830c66f

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

packages/gapic-generator/gapic/schema/wrappers.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,19 +1284,13 @@ def _to_regex(self, path_template: str) -> Pattern:
12841284
return re.compile(f"^{self._convert_to_regex(path_template)}$")
12851285

12861286
# Use caching to avoid repeated computation
1287-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2161):
1288-
# Use `@functools.cache` instead of `@functools.lru_cache` once python 3.8 is dropped.
1289-
# https://docs.python.org/3/library/functools.html#functools.cache
1290-
@functools.lru_cache(maxsize=None)
1287+
@functools.cache
12911288
def to_regex(self) -> Pattern:
12921289
return self._to_regex(self.path_template)
12931290

12941291
@property
12951292
# Use caching to avoid repeated computation
1296-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2161):
1297-
# Use `@functools.cache` instead of `@functools.lru_cache` once python 3.8 is dropped.
1298-
# https://docs.python.org/3/library/functools.html#functools.cache
1299-
@functools.lru_cache(maxsize=None)
1293+
@functools.cache
13001294
def key(self) -> Union[str, None]:
13011295
if self.path_template == "":
13021296
return self.field

0 commit comments

Comments
 (0)