reticulate py_run and local environments in R

I am writing R6 classes including some key lines of python code in their methods using py_eval routines of reticulate. In those calls I naturally need to use the member variables of the particular local environment. The advised r.varname reference in those calls seem to see only Global Environment in R, not local members.

Are there any means in py_run calls to reach the member variables of the local R6 objects (or actually environments) instead of variables just in the Global Environment?

(Or am I missing something very simple...)

You aren't missing anything -- the helper r object currently does only access objects within the R global environment. We've thought about changing this, but haven't decided one way or another just yet.

You might want to file this at https://github.com/rstudio/reticulate/issues. Thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.