-
Notifications
You must be signed in to change notification settings - Fork 12
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
List errors which might be raised in function docstrings #53
Comments
dicej
added a commit
that referenced
this issue
Jan 12, 2024
If the WIT representation of a function returns `result<A,B>`, then we generate a Python function that returns `A` and raises `Err(B)`. Since there's currently no way of representing the `Err(B)` part in the function's signature, we do the next best thing: put it in the docstring. Fixes #53 Signed-off-by: Joel Dice <joel.dice@fermyon.com>
dicej
added a commit
that referenced
this issue
Jan 12, 2024
If the WIT representation of a function returns `result<A,B>`, then we generate a Python function that returns `A` and raises `Err(B)`. Since there's currently no way of representing the `Err(B)` part in the function's signature, we do the next best thing: put it in the docstring. Fixes #53 Signed-off-by: Joel Dice <joel.dice@fermyon.com>
dicej
added a commit
that referenced
this issue
Jan 12, 2024
If the WIT representation of a function returns `result<A,B>`, then we generate a Python function that returns `A` and raises `Err(B)`. Since there's currently no way of representing the `Err(B)` part in the function's signature, we do the next best thing: put it in the docstring. Fixes #53 Signed-off-by: Joel Dice <joel.dice@fermyon.com>
dicej
added a commit
that referenced
this issue
Jan 12, 2024
If the WIT representation of a function returns `result<A,B>`, then we generate a Python function that returns `A` and raises `Err(B)`. Since there's currently no way of representing the `Err(B)` part in the function's signature, we do the next best thing: put it in the docstring. Fixes #53 Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python does not currently have a way to represent the types of errors/exceptions which might be raised by a function in a typed function signature, so the next best thing is to list them in the docstring (e.g. following any docs derived from WIT doc comments).
The text was updated successfully, but these errors were encountered: