Object management

Once the Python extension module is built and imported, an instance can be created. For example, given the Args.Cdouble example in Subsection 11.2.2 with the method passeverywhere, the process for instantiating the class and printing its calling signature is$:$


$ python
>>> import Args.Cdouble
>>> obj = Args.Cdouble.Cdouble()
>>> print obj.passeverywhere.__doc__
passeverywhere(in double d1,
               inout double d3)
RETURNS
   (double _return,
    out double d2,
    inout double d3)

In this case the last part of the class name is repeated when assigning the instance to obj. Any SIDL document comments (i.e. comments enclosed in /** */) will appear below the signature documentation.

In some cases, the Python extension module may be named Cdoublemodule.so instead of simply Cdouble.so. This might result in the temptation to import Args.Cdoublemodule instead of import Args.Cdouble; resist!





babel-1.4.0
users_guide Last Modified 2008-10-16

http://www.llnl.gov/CASC/components
components@llnl.gov