summaryrefslogtreecommitdiff
path: root/jsonschema
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-08-30 11:07:21 +0300
committerJulian Berman <Julian@GrayVines.com>2022-08-30 11:07:21 +0300
commit6d04fd7041e2cf45836f04858183b453c0b551c3 (patch)
treee63a495412b82a4586bf3efc9638cd093c5f96b2 /jsonschema
parentfd491f971e7197329e200df1f98fcb6e39779bd7 (diff)
downloadjsonschema-6d04fd7041e2cf45836f04858183b453c0b551c3.tar.gz
Remove the incorrect Optional from FormatChecker's formats annotation.
See https://docs.python.org/3/library/typing.html#typing.Optional. This is meant to be used only if None is a specifically allowed value, where here it is not, it's an internal sentinel, not part of its public API, which only allows iterables.
Diffstat (limited to 'jsonschema')
-rw-r--r--jsonschema/_format.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/jsonschema/_format.py b/jsonschema/_format.py
index 2c07719..6a25461 100644
--- a/jsonschema/_format.py
+++ b/jsonschema/_format.py
@@ -44,7 +44,7 @@ class FormatChecker:
tuple[_FormatCheckCallable, _RaisesType],
] = {}
- def __init__(self, formats: typing.Iterable[str] | None = None):
+ def __init__(self, formats: typing.Iterable[str] = None):
if formats is None:
formats = self.checkers.keys()
self.checkers = {k: self.checkers[k] for k in formats}