From b93b969e2a63baddb2bf822104f423b5719499c4 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 4 Dec 2014 18:04:54 +0800 Subject: [PATCH] doc/pc_rpc: add warning about mutable types --- artiq/management/pc_rpc.py | 6 ++++++ doc/manual/writing_a_driver.rst | 2 ++ 2 files changed, 8 insertions(+) diff --git a/artiq/management/pc_rpc.py b/artiq/management/pc_rpc.py index e712a7a8b..286baad33 100644 --- a/artiq/management/pc_rpc.py +++ b/artiq/management/pc_rpc.py @@ -4,6 +4,12 @@ between conventional computers (PCs) running Python. It strives to be transparent and uses ``artiq.management.pyon`` internally so that e.g. Numpy arrays can be easily used. +Note that the server operates on copies of objects provided by the client, +and modifications to mutable types are not written back. For example, if the +client passes a list as a parameter of an RPC method, and that method +``append()s`` an element to the list, the element is not appended to the +client's list. + """ import socket diff --git a/doc/manual/writing_a_driver.rst b/doc/manual/writing_a_driver.rst index e02b07988..061e8d725 100644 --- a/doc/manual/writing_a_driver.rst +++ b/doc/manual/writing_a_driver.rst @@ -83,6 +83,8 @@ Run it as before, while the controller is running. You should see the message ap When using the driver in an experiment, for simple cases the ``Client`` instance can be returned by the :class:`artiq.language.core.AutoContext` mechanism and used normally as a device. +:warning: RPC servers operate on copies of objects provided by the client, and modifications to mutable types are not written back. For example, if the client passes a list as a parameter of an RPC method, and that method ``append()s`` an element to the list, the element is not appended to the client's list. + Command-line arguments ----------------------