metaclass error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron Steele

    #1

    metaclass error

    hi,

    i have a very simple package organized as follows:

    !-----------------------------------------!
    bgp/
    __init__.py
    managers/
    __init__.py
    ManagerInterfac e.py
    TestManager.py
    !-----------------------------------------!

    and here's ManagerInterfac e.py and TestManager.py:

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

    # TestManager.py
    import ManagerInterfac e
    class TestManager(Man agerInterface):
    def process(self, recset, operation):
    print 'In TestManager.pro cess()...'
    super(TestManag er,self).proces s(recset,operat ion)
    !-------------------------------------------!

    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 linux2[color=blue][color=green][color=darkred]
    >>> import bgp.managers.Te stManager[/color][/color][/color]
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "bgp/managers/TestManager.py" , line 2, in ?
    class TestManager(Man agerInterface):
    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 (ManagerInterfa ce) into a tuple
    and then executes the class body in a dictionary... is this where the
    error is happening?

    thanks!
    aaron

Working...