diff options
author | Julian Berman <Julian@GrayVines.com> | 2022-07-26 10:51:19 +0300 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2022-07-26 10:51:19 +0300 |
commit | 8e090fb258e6500940e2177dfc0fd5cd73fc5e14 (patch) | |
tree | b1a7fc9af0e167b6962ae9a5d2d53e9aa37da749 /jsonschema/validators.py | |
parent | e9e90199ea43ab9f48ced4347b6ad95e70fa08ca (diff) | |
download | jsonschema-8e090fb258e6500940e2177dfc0fd5cd73fc5e14.tar.gz |
Micro-optimize an oft-called lambda to a methodcaller call.
Diffstat (limited to 'jsonschema/validators.py')
-rw-r--r-- | jsonschema/validators.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/jsonschema/validators.py b/jsonschema/validators.py index f986f1c..7cedcff 100644 --- a/jsonschema/validators.py +++ b/jsonschema/validators.py @@ -6,6 +6,7 @@ from __future__ import annotations from collections import deque from collections.abc import Sequence from functools import lru_cache +from operator import methodcaller from urllib.parse import unquote, urldefrag, urljoin, urlsplit from urllib.request import urlopen from warnings import warn @@ -112,7 +113,7 @@ def create( type_checker=_types.draft202012_type_checker, format_checker=_format.draft202012_format_checker, id_of=_id_of, - applicable_validators=lambda schema: schema.items(), + applicable_validators=methodcaller("items"), ): """ Create a new validator class. |