Arguments of function as out

Jeff Epler jepler at unpythonic.net
Thu Sep 4 14:51:15 CEST 2003


On Thu, Sep 04, 2003 at 08:12:57AM +0200, Birgit Rahm wrote:
> 
> Thank you,
> I've already read this, but I hoped, there is a way to get these out
> parameters beside this.
> Because I cant redesign the function on the server side. So I have only the
> possibility to change the client side code, which calls this function.
> It seems there is no way in python to use it and get the new out paramter
> value after finishing the function.
> Birgit

I found this result when searching for 'omniorbpy "out parameter"':
    http://www.omniorb-support.com/pipermail/omniorb-list/2000-April/015244.html
I don't know for certain that this is the way omniorbpy behaves today,
but it is a very pythonic way to work.

| From: Duncan Grisby <dgrisby at uk dot research dot att dot com>
| Subject: [omniORB] omniORBpy out parameter passing issue
|
[...]
| Out arguments in the Python mapping appear as extra return values in a
| tuple. So, if you have IDL
| 
| interface I {
|   long op(in string a, out short b, inout double c);
| };
| 
| Then to call op, you do
| 
|   (result, b, c) = i.op(a, c)
| 
| I recommend that you read the mapping specification, which you can
| download from
| 
|   http://www.omg.org/cgi-bin/doc?ptc/00-01-12
| 
| Cheers,
| 
| Duncan.

Jeff





More information about the Python-list mailing list