You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
x<-reticulate::r_to_py(1:3)
# we want this:
construct(x)
#> reticulate::r_to_py(1:3)x# x is actually an environment with a printing method#> [1, 2, 3]
construct(py_to_r(x)) # but we can construct the equivalent R object, so we have all we need #> 1:3
General steps :
Define a template using .cstr_new_class("python.builtin.object", constructor = "reticulate::r_to_py", commented = TRUE) that we save in the R folder as s3-python.builtin.object.R
If we document, reload and retry construct(x) should already return something different.
Adapt .cstr_construct.python.builtin.object.r_to_py() so construct(x) returns r_to_py(1:3), look at other examples in the package, here we can use idiomatic_class = class(x) to avoid class repair
document and snapshot tests
The text was updated successfully, but these errors were encountered:
General steps :
.cstr_new_class("python.builtin.object", constructor = "reticulate::r_to_py", commented = TRUE)
that we save in the R folder ass3-python.builtin.object.R
construct(x)
should already return something different..cstr_construct.python.builtin.object.r_to_py()
soconstruct(x)
returnsr_to_py(1:3)
, look at other examples in the package, here we can useidiomatic_class = class(x)
to avoid class repairThe text was updated successfully, but these errors were encountered: