Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Auto Closed
-
0.12
-
None
-
None
-
Fedora 15, not that it matters.
Description
When calling a method from the Python QMF API, the number of arguments provided is checked against the schema and an exception raised if they do not match. This means that there is no way to update a schema (e.g. by adding new, optional parameters to a command) without also breaking existing Python console scripts.
Note that the C++ implementation has no such restriction, so there is no technical reason for it.
This check should be removed for the case where there are fewer arguments provided than specified by the schema. The checking of keyword arguments is currently pretty limited - e.g. they may overlap with positional arguments, or may be for fields not present in the schema (in both cases they are ignored).
Ideally, additional keyword arguments beyond the ones present in the schema should also be allowed (this appears to be possible; I don't see the schema being used to identify the parameter's type, so I assume it is inferred). This would allow new scripts to continue to talk to both new and old agents without having to check the schema.