For each in parameter of a Slice operation, the Python mapping generates a corresponding parameter for the corresponding method. In addition, every operation has an additional, trailing parameter of type
Ice.Current. For example, the
name operation of the
Node interface has no parameters, but the
name method in a Python servant has a
current parameter. We explain the purpose of this parameter in
Section 32.6 and will ignore it for now.
An operation returning multiple values1 returns them in a tuple consisting of a non-
void return value, if any, followed by the
out parameters in the order of declaration. An operation returning only one value simply returns the value itself.
The signatures of the Python methods are identical because they all accept a single in parameter, but their implementations differ in the way they return values. For example, we could implement the operations as follows:
Notice that op1 and
op2 return their string values directly, whereas
op3 returns a tuple consisting of the return value followed by the
out parameter.
This code is in no way different from what you would normally write if you were to pass strings to and from a function; the fact that remote procedure calls are involved does not impact on your code in any way. The same is true for parameters of other types, such as proxies, classes, or dictionaries: the parameter passing conventions follow normal Python rules and do not require special-purpose API calls.