[PYTHON C++-SIG] LLNL Python/C++ integration: current status

Skip Montanaro skip at automatrix.com
Mon Feb 17 17:18:57 CET 1997


>>>>> "Geoffrey" == Geoffrey Furnish <furnish at laura.llnl.gov> writes:

    Geoffrey> Here's a quick example.  The following is the Foo::crash method I
    Geoffrey> presented yesterday, augmented to pull out a couple of arguments from
    Geoffrey> the args tuple.

    Geoffrey> PyObject *Foo::crash( PyArgs *args )
    Geoffrey> {
    Geoffrey>     cout << "In Foo::crash\n" << flush;

    Geoffrey>     {
    Geoffrey> 	int x, y;
    args-> ParseTuple( x, y );
    Geoffrey> 	cout << "x=" << x << " y=" << y << endl;
    Geoffrey>     }

    Geoffrey>     throw "flaming oblivion";

    Geoffrey>     Py_INCREF( Py_None );
    Geoffrey>     return Py_None;
    Geoffrey> }

    ...

    Geoffrey> Now, how do we implement this?  Here is the PyArgs class:

    ...

How do you handle defaults and keyword arguments?

-- 
Skip Montanaro     |    Python - it's not just for scripting anymore...
skip at calendar.com  |                            http://www.python.org/
(518)372-5583      |    Musi-Cal ------> http://concerts.calendar.com/

_______________
C++-SIG - SIG for Development of a C++ Binding to Python

send messages to: c++-sig at python.org
administrivia to: c++-sig-request at python.org
_______________



More information about the Cplusplus-sig mailing list