Arguments of function as out

Jeff Epler jepler at
Thu Sep 4 15:42:43 CEST 2003

On Thu, Sep 04, 2003 at 07:51:15AM -0500, Jeff Epler wrote:
> I found this result when searching for 'omniorbpy "out parameter"':
> I don't know for certain that this is the way omniorbpy behaves today,
> but it is a very pythonic way to work.
> | I recommend that you read the mapping specification, which you can
> | download from
> | 
> |

[Replying to my own post]

The current version of that document can be retrieved from

Page 1-12 discusses the treatment of "out" and "inout" parameters and
the mapping onto Python return values:

    Operations of an interface map to methods available on the object
    references.  Parameters with a parameter attribute of in or inout are
    passed from left to right to the method, skipping out parameters. The
    return value of a method depends on the number of out parameters
    and the return type. If the operation returns a value, this value
    forms the first result value. All inout or out parameters form
    consecutive result values. The method result depends then on the
    number of result values:
      . If there is no result value, the method returns None.
      . If there is exactly one result value, it is returned as a
        single value.
      . If there is more than one result value, all of them are packed
        into a tuple, and this tuple is returned.

    Assuming the IDL definition

        interface I{
            oneway void stop();
            bool more_data();
            void get_data(out string name,out long age);

    a client could write

        while my_I.more_data():
            name,age = my_I.get_data()


More information about the Python-list mailing list