rstudio / reticulate

R Interface to Python
https://rstudio.github.io/reticulate
Apache License 2.0
1.68k stars 328 forks source link

Class Methods Are dropped #514

Open alexeijiltsov opened 5 years ago

alexeijiltsov commented 5 years ago

Using reticulate from RStudio

class CTest:
    def __init__(self, x, y):
        self.x = x 
        self.y = y

    def ff(self):
        self.x = self.x + 1 

    def bb(self):
        self.x = self.x + 1 

x = CTest(2,3)        
x.x
x.ff()
x.bb()

observe this

image

session info as follows

> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8        LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8    LC_PAPER=C.UTF-8       LC_NAME=C             
 [9] LC_ADDRESS=C           LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.0  Matrix_1.2-17   tools_3.6.0     Rcpp_1.0.1      reticulate_1.12 grid_3.6.0      jsonlite_1.6    png_0.1-7       lattice_0.20-38
RobertWan91 commented 5 years ago

I have similar issues. It could be greatly if anyone could kindly help.

skeydan commented 5 years ago

Hi, can you try reinstalling reticulate from master? I cannot reproduce the error...