Extend DeviceProxy [] syntax to support multiple attribute read/write
After a very interesting talk with @vxgmichel about numpy array [] syntax it occured to me we also have this in PyTango, only we dont have extended syntax.
I propose to extend the item access []
syntax of device proxy to support read and write multiple attributes:
>>> import tango
>>> d = tango.DeviceProxy("sys/tg_test/1")
>>> # Currently available:
>>> d["state"]
DeviceAttribute(...)
>>> # Extension:
>>> d["state", "status", "ushort_spectrum"]
[DeviceAttribute(...), DeviceAttribute(...), DeviceAttribute(...)]
>>> # same for writing
>>> d["ushort_spectrum", "double_scalar"] = (1,2,3), 5.4
>>> # Not so sure about slices:
>>> # Maybe allow only this (reads all attributes):
>>> d[:]
[DeviceAttribute(...), ..., ..., DeviceAttribute(...)]
Edited by Anton Joubert