Skip to content

Changing rpc constants on proxy#214

Open
heevasti wants to merge 11 commits into
mainfrom
changing-rpc-constants-on-proxy
Open

Changing rpc constants on proxy#214
heevasti wants to merge 11 commits into
mainfrom
changing-rpc-constants-on-proxy

Conversation

@heevasti
Copy link
Copy Markdown
Collaborator

Related to #213.

With this, the "RPC constants" that are class constants on a RPC object, e.g. QMI_Instrument, can now be modified so that the modifications propagate back to the actual object, and not proxy only. With this, the proxy class of the object was also made prohibitive on adding new class constants, RPC constants can only be modified with same type (and size if applicable) values, and also class constants not defined with _rpc_constants are not modifiable and will lead to an AttributeError.

Some tutorial examples were also added to illustrate this new functionality.

Henri Ervasti and others added 11 commits May 19, 2026 17:07
…the class constants marked with `_rpc_constants = ["constant_a", "constant_b", ...]` can be changed by calling `class_rpc_proxy_inst.constant_a(new_value)`. The new value must be of same type and length as the original value to be able to change the value. This means that e.g. `None` cannot be used to set the RPC constant as 'optional', and the constant cannot have union of types either. Need to edit the documentation about this still.
…thout a new value to return the current value.
…t value calls to be settables and gettables instead, so that they can be modified like any class attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant