Skip to content

Commit

Permalink
Ignore a style warning from bugbear.
Browse files Browse the repository at this point in the history
Creating lots of RefResolvers shouldn't be common (as creating lots
of Validators should be reasonably uncommon itself), and even if
one did so, we have a fixed size LRU cache, so this seems OK.

Refs: PyCQA/flake8-bugbear#218
  • Loading branch information
Julian committed Apr 15, 2022
1 parent 2e28324 commit ae8be4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jsonschema/validators.py
Expand Up @@ -802,7 +802,7 @@ def resolving(self, ref):
def _find_in_referrer(self, key):
return self._get_subschemas_cache()[key]

@lru_cache()
@lru_cache() # noqa: B019
def _get_subschemas_cache(self):
cache = {key: [] for key in _SUBSCHEMAS_KEYWORDS}
for keyword, subschema in _utils.search_schema(
Expand All @@ -811,7 +811,7 @@ def _get_subschemas_cache(self):
cache[keyword].append(subschema)
return cache

@lru_cache()
@lru_cache() # noqa: B019
def _find_in_subschemas(self, url):
subschemas = self._get_subschemas_cache()["$id"]
if not subschemas:
Expand Down

0 comments on commit ae8be4a

Please sign in to comment.