[omniORB] omniORBpy
Richard Gruet
rgruet@ina.fr
Thu, 02 Mar 2000 13:16:06 +0100
--------------28FB07502DB58996FA416AE4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Stefan,
An IDL sequence simply doesn't exist in Python. It is mapped onto a
Python sequence (tuple or list).
Therefore:
interface I {
typedef sequence<X> WSeq;
void foo(in XSeq arg);
};
- If you are a Python caller of foo, just pass a tuple or list of X for
<arg>.
- if you are a Python implementor of foo(), you will get a tuple or list
of X as value for <arg>.
You should not assume that <arg> is mutable (ie is a list rather than a
tuple).
Cheers,
Richard
PS: I think Python is far simpler to use than C++ as a language for
Corba programming, unless you're somewhat pervert and love the C
reference management ;-)
Stefan Seefeld wrote:
> I have the following IDL construct:
>
> interface Kit
> {
> struct Property{/*...*/};
> typedef sequence<Property> PropertySeq;
> };
>
> In my python code I try to instantiate a PropertySeq
> but all attempts fail. My last try was
>
> properties = Warsaw.Kit.PropertySeq();
>
> which results in the message that I can't instantiate a
> 'Kit'... ('Warsaw' is the module I compile all global interface
> into)
> How should I do that ? (python's scope rules are somewhat
> confusing at least compared to the straightforward C++ way.
>
--------------28FB07502DB58996FA416AE4
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Stefan,
<p>An IDL sequence simply doesn't exist in Python. It is mapped onto a
Python sequence (tuple or list).
<br>Therefore:
<p> interface I {
<br> typedef sequence<X> WSeq;
<br> void foo(in XSeq arg);
<br> };
<p>- If you are a Python caller of foo, just pass a tuple or list
of X for <arg>.
<br>- if you are a Python implementor of foo(), you will get a tuple or
list of X as value for <arg>.
<br> You should not assume that <arg> is mutable (ie is a list
rather than a tuple).
<p>Cheers,
<p>Richard
<p>PS: I think Python is far simpler to use than C++ as a language
for Corba programming, unless you're somewhat pervert and love the
C reference management ;-)
<br>
<p><i>Stefan Seefeld wrote:</i>
<blockquote TYPE=CITE><i>I have the following IDL construct:</i>
<p><i>interface Kit</i>
<br><i>{</i>
<br><i> struct Property{/*...*/};</i>
<br><i> typedef sequence<Property> PropertySeq;</i>
<br><i>};</i>
<p><i>In my python code I try to instantiate a PropertySeq</i>
<br><i>but all attempts fail. My last try was</i>
<p><i>properties = Warsaw.Kit.PropertySeq();</i>
<p><i>which results in the message that I can't instantiate a</i>
<br><i>'Kit'... ('Warsaw' is the module I compile all global interface</i>
<br><i>into)</i>
<br><i>How should I do that ? (python's scope rules are somewhat</i>
<br><i>confusing at least compared to the straightforward C++ way.</i>
<br> </blockquote>
</html>
--------------28FB07502DB58996FA416AE4--