diff --git a/voluptuous/validators.py b/voluptuous/validators.py index 776adb8..c513d19 100644 --- a/voluptuous/validators.py +++ b/voluptuous/validators.py @@ -102,7 +102,7 @@ class Coerce(object): ... validate('foo') """ - def __init__(self, type: type, msg: typing.Optional[str] = None) -> None: + def __init__(self, type: typing.Union[type, typing.Callable], msg: typing.Optional[str] = None) -> None: self.type = type self.msg = msg self.type_name = type.__name__