Skip to content
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

reticulate::py_capture_output(type = NULL) #1760

Open
tyner opened this issue Mar 6, 2025 · 0 comments
Open

reticulate::py_capture_output(type = NULL) #1760

tyner opened this issue Mar 6, 2025 · 0 comments

Comments

@tyner
Copy link

tyner commented Mar 6, 2025

One lesser known (but fully documented) feature of match.arg is it regards arg = NULL as equivalent to the first element of choices:

> match.arg(arg = NULL, choices = c("stdout", "stderr"))
[1] "stdout"

As a result, these two calls yield identical output:

reticulate::py_capture_output(expr, type = NULL)
reticulate::py_capture_output(expr, type = "stdout")

If this is the intended behavior of py_capture_output, it might be nice to document that on the help page.

If it is not the intended behavior, then perhaps py_capture_output could throw an error when type = NULL.

Thank you for considering.

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