Skip to content

Commit 6aa3b13

Browse files
committed
chore(gapic): use functools.cache instead of lru_cache in wrappers.py
1 parent 6521a1b commit 6aa3b13

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
@@ -1290,19 +1290,13 @@ def _to_regex(self, path_template: str) -> Pattern:
12901290
return re.compile(f"^{self._convert_to_regex(path_template)}$")
12911291

12921292
# Use caching to avoid repeated computation
1293-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2161):
1294-
# Use `@functools.cache` instead of `@functools.lru_cache` once python 3.8 is dropped.
1295-
# https://docs.python.org/3/library/functools.html#functools.cache
1296-
@functools.lru_cache(maxsize=None)
1293+
@functools.cache
12971294
def to_regex(self) -> Pattern:
12981295
return self._to_regex(self.path_template)
12991296

13001297
@property
13011298
# Use caching to avoid repeated computation
1302-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2161):
1303-
# Use `@functools.cache` instead of `@functools.lru_cache` once python 3.8 is dropped.
1304-
# https://docs.python.org/3/library/functools.html#functools.cache
1305-
@functools.lru_cache(maxsize=None)
1299+
@functools.cache
13061300
def key(self) -> Union[str, None]:
13071301
if self.path_template == "":
13081302
return self.field

0 commit comments

Comments
 (0)