Skip to content

Commit

Permalink
Remove the incorrect Optional from FormatChecker's formats annotation.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Julian committed Aug 30, 2022
1 parent fd491f9 commit 6d04fd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsonschema/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 6d04fd7

Please sign in to comment.