hive
hive copied to clipboard
Update function signatures to use result type
Right now our functions that might fail mid-simulation have a signature that looks like:
def function_that_might_fail() -> Tuple[Optional[Exception], Optional[Type]]:
We could add in this Result type such that the signature would be reduced to:
def function_that_might_fail() -> Result[Type, str]:
This be especially useful if we implement #83 as it would give us a mypy error if we don't handle the result properly.
Another possible solution: https://github.com/keithasaurus/koda