[Tutor] Class error

Luke Paireepinart rabidpoobear at gmail.com
Sun Jun 17 19:43:48 CEST 2007


Henry Dominik wrote:
> Hello people,
>
> I was trying my hands on Python's Classes and have a first hurdle and can't 
> seem to get past it.
>
> -----Below is the error message ------
>
> Traceback (most recent call last):
>   File "C:/Development/python/EmplAddrBookEntry.py", line 3, in -toplevel-
>     class EmplAddrBookEntry(AddrBookEntry):
> TypeError: Error when calling the metaclass bases
>     module.__init__() takes at most 2 arguments (3 given)
>   
It says "module.__init__" not "AddrBookEntry.__init__" which leads me to 
believe that
> ----------------------AddrBookEntry.py-------------------------------------
>   
the filename of your module
> class AddrBookEntry(object):
>   
and the class name itself are confusing you.
> import AddrBookEntry
>
> class EmplAddrBookEntry(AddrBookEntry):
>
>     def __init__(self, nm, ph, id, em):
>         AddrBookEntry.__init__(self, nm, ph)
>   
I believe this should be "AddrBookEntry.AddrBookEntry.__init__"

I can't be certain, but that's what it looks like off the top of my head.
-Luke


More information about the Tutor mailing list