dtype problem
|
|
---|---|
hello Guys, I have a problem with dtype_in. I've been trying to make command method which will take two different type arguments like string and bool. I wanted to use list or tuple. But is problem because its required the same typ for example: @command(dtype_in=[str], dtype_out=bool) only str, int et cetera. The question is, how can I pass for example str and bool arguments to command method? |
|
|
---|---|
Hi Dariusz There is no standard Tango datatype with a mixture of str and bool arguments. Using dtype_in=str for the command, and treating it as a JSON-serialised string is a common way to solve this. See this discussion in a PyTango issue for an example of dealing with complex types (it was written for dtype_out, but the same applies to dtype_in. If you are dealing with very complex data structures and versioning, it might be useful to define a JSON schema. The SKA project is using this approach for validation . /Anton |