arguments problem~
Dan Bishop
danb_83 at yahoo.com
Thu Dec 25 01:54:37 EST 2003
black <quiteblack at yahoo.com> wrote in message news:<mailman.107.1072321672.684.python-list at python.org>...
...
> i coded a class say named "A" which can receive arbitrary arguments and all
> works fine but problem came when i created another class "B" which
> inherited "A". it can not receive arguments as expected, ie it collected
> keywords arguments to nonekeywords arguments tuple and keep keywords dict
> empty. My destination is just to pass all keywords from A to B without any
> modification and same does nonekeywords. below is my code, I'd much
> appreciate if anyone could inspires me, thanx~
>
> class A:
> def __init__(self, *args, **kw):
> print args
> print kw
> print
> class B(A):
> def __init__(self, *args, **kw):
> A.__init__(self, args, kw)
The above line should be
A.__init__(self, *args, **kw)
More information about the Python-list
mailing list