Closed vickumar1981 closed 11 months ago
Yeah, you're absolutely right. No ideas why I've used Callable[[A], None]
type...
@sloboegen Looks like this little change I made, breaks the case when the Future
fails, but only for Python 3.11:
https://github.com/vickumar1981/pyeffects/actions/runs/6343401249/job/17231190521
Thanks for adding those tests. Would probably have never caught this otherwise! 👍
@sloboegen
Fixes the signature of the
on_failure
method forFuture
.The callable that is passed should take in an exception and do nothing w/ it b/c
on_failure
is explicitly meant to handle side-effecting from an exception. i.e., i think the proper signature isCallable[[Exception], None]
-> a function that takes in an exception and does nothing with it, just like your example that you provided in the docs.The function being passed in takes an exception and returns nothing (None).