8000 Update function signatures to use result type · Issue #84 · NREL/hive · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update function signatures to use result type #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nreinicke opened this issue Jan 27, 2022 · 1 comment
Open

Update function signatures to use result type #84

nreinicke opened this issue Jan 27, 2022 · 1 comment
Milestone

Comments

@nreinicke
Copy link
Collaborator

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.

@nreinicke nreinicke added this to the nice-to-haves milestone Jan 27, 2022
@nreinicke
Copy link
Collaborator Author

Another possible solution: https://github.com/keithasaurus/koda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0