I'm using Python 3 on the Linux box and classic rpyc to the same host. Having the simple python file, tst.py, in the current directory with two lines in it:
a = {'a': 0}
b = 3
Then I run the following commands:
>>> import rpyc; conn = rpyc.classic.connect('127.0.0.1')
>>> conn.execute('import tst')
>>> conn.eval('dir(tst)')
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__',
'__package__', '__spec__', 'a', 'b']
>>> conn.eval('tst.a, tst.b')
({'a': 0, 'b': 1}, 3)
Everything is as expected. If I close the connection now: "conn.close()", close the python session, delete 'pycache' from the current directory, edit "tst.py" file, leaving only one line in it:
a = {'a': 0, 'b': 2}
and repeat the same commands above from the scratch in a new session:
..... (skipped) ...
>>> conn.eval('dir(tst)')
'__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__',
'__package__', '__spec__', 'a', 'b']
>>> conn.eval('tst.a, tst.b')
({'a': 0, 'b': 1}, 3)
So, surprisingly, the result remains the same though the tst.py file changed and the local python cache has been deleted. Can somebody explain to newbie what I've done wrongly and how to clean the previous loaded code. Does "rpyc" have it's own cache? If you change the name of this "tst.py" file and repeat the same procedure again with a new name, then the result will be correct. Again, this points to caching but not in current directory.