Skip to content

Commit ae8be4a

Browse files
committed
Ignore a style warning from bugbear.
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
1 parent 2e28324 commit ae8be4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jsonschema/validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ def resolving(self, ref):
802802
def _find_in_referrer(self, key):
803803
return self._get_subschemas_cache()[key]
804804

805-
@lru_cache()
805+
@lru_cache() # noqa: B019
806806
def _get_subschemas_cache(self):
807807
cache = {key: [] for key in _SUBSCHEMAS_KEYWORDS}
808808
for keyword, subschema in _utils.search_schema(
@@ -811,7 +811,7 @@ def _get_subschemas_cache(self):
811811
cache[keyword].append(subschema)
812812
return cache
813813

814-
@lru_cache()
814+
@lru_cache() # noqa: B019
815815
def _find_in_subschemas(self, url):
816816
subschemas = self._get_subschemas_cache()["$id"]
817817
if not subschemas:

0 commit comments

Comments
 (0)