forked from M-Labs/artiq
1
0
Fork 0

doc/pc_rpc: add warning about mutable types

This commit is contained in:
Sebastien Bourdeauducq 2014-12-04 18:04:54 +08:00
parent 044756287f
commit b93b969e2a
2 changed files with 8 additions and 0 deletions

View File

@ -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 transparent and uses ``artiq.management.pyon`` internally so that e.g. Numpy
arrays can be easily used. 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 import socket

View File

@ -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. 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 Command-line arguments
---------------------- ----------------------