Closed cdce8p closed 4 months ago
I don't really understand this change. All validators are callable, so this seems like it should be a valid constraint.
But maybe it should be using Schemable
instead
All validators are callable, so this seems like it should be a valid constraint.
Validators can be
callables but don't have to. Just as example, consider vol.Maybe({"key": int})
.
Schemable
seems to be a good alternative. Used that instead.
Sweet, thanks.
Ref https://github.com/home-assistant/core/pull/120450#issuecomment-2189661020
The
validator
type forMaybe
shouldn't be limited toCallable
. In the end it is passed to_WithSubValidators
throughvalidators
which is currently untyped. https://github.com/alecthomas/voluptuous/blob/2232c0e556bc68343388fa8499bdbf13196a7514/voluptuous/validators.py#L218-L228Removed the incorrect typing from
Maybe
for now.Refs https://github.com/home-assistant/core/pull/120268