You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the Maybe change to propagate error information (#411) was not intended to be a breaking change. Unfortunately, this is a breaking change because many consumers rely on Any's short-circuiting behavior. That is, the following code now does not do the same thing anymore:
def validator_that_raises_typeerror(x):
if x is None:
raise TypeError('Ooops')
return x
s = Maybe(validator_that_raises_typeerror)
# pre 0.12.1
s(None) # => returns None
# post 0.12.1
s(None) # => throws TypeError
You can argue that the validator above is malformed, and you may be right; however, it doesn't change the fact that voluptuous currently allows that validator and the Maybe change results in different behavior, not just more error information.
The text was updated successfully, but these errors were encountered:
Revert Breaking Maybe change in 0.12.1
It seems like the
Maybe
change to propagate error information (#411) was not intended to be a breaking change. Unfortunately, this is a breaking change because many consumers rely onAny
's short-circuiting behavior. That is, the following code now does not do the same thing anymore:You can argue that the validator above is malformed, and you may be right; however, it doesn't change the fact that voluptuous currently allows that validator and the
Maybe
change results in different behavior, not just more error information.The text was updated successfully, but these errors were encountered: