metaclass error

A

Aaron Steele

hi,

i have a very simple package organized as follows:

!-----------------------------------------!
bgp/
__init__.py
managers/
__init__.py
ManagerInterface.py
TestManager.py
!-----------------------------------------!

and here's ManagerInterface.py and TestManager.py:

!-----------------------------------------!
# ManagerInterface.py
class ManagerInterface(object):
def __init__(self): pass
def process(self, recset, operation):
print 'In ManagerInterface.process()...'

# TestManager.py
import ManagerInterface
class TestManager(ManagerInterface):
def process(self, recset, operation):
print 'In TestManager.process()...'
super(TestManager,self).process(recset,operation)
!-------------------------------------------!

when i try to import the TestManager module via the interpreter, i get
the following error:

!-------------------------------------------!
$ python
Python 2.4.1c1 (#1, Mar 14 2005, 10:28:18)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-49)] on linux2Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "bgp/managers/TestManager.py", line 2, in ?
class TestManager(ManagerInterface):
TypeError: Error when calling the metaclass bases
module.__init__() takes at most 2 arguments (3 given)
!-------------------------------------------!

any thoughts? i think that when python executes the TestManager class
statement, it collects the base class (ManagerInterface) into a tuple
and then executes the class body in a dictionary... is this where the
error is happening?

thanks!
aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top