Duh
of course. Not sure what I had done in Python/Python.
Now it works. Thanks a lot.
Sven Erik
Chris Mellon wrote:
On Nov 27, 2007 6:47 AM, Sven Erik Knop <[EMAIL PROTECTED]> wrote:
Hi
I am getting slightly frustrated and wonder if you can help me.
Consider a Python class Foo implemented in C++. I have declared an
initialization method like this
static int
Foo_init(P4Adapter *self, PyObject *args, PyObject *kwds)
{
}
and I am subclassing Foo in Python, which works fine in principle,
except for passing keywords.
Here is the subclass:
class Bar(Foo):
def __init__(self, *args, **kwlist):
Foo.__init__(self, args, kwlist)
This passes the args tuple and the kw dict as 2 regular arguments. You
need to expand them in the second call if you want them to be passed
as args and kwargs -
Foo.__init__(self, *args, **kwargs)
--------------------------------------------------------------------------------
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
you have received this email in error please notify the system manager. Please
note that any views or opinions presented in this email are solely those of the
author and do not necessarily represent those of Perforce Software. Finally,
the recipient should check this email and any attachments for the presence of
viruses. Perforce Software accepts no liability for any damage caused by any
virus transmitted by this email.
Perforce Software UK Ltd is registered in England and Wales as company no.
3816019 at the following address: West Forest Gate, Wellington Road, Wokingham,
RG40 2AQ, UK
--------------------------------------------------------------------------------
--
http://mail.python.org/mailman/listinfo/python-list