David Marrs
January 15th, 2006, 10:11 AM
So I finally decided to try this python thing you all keep going on about! :p
I've been trying to inherit a class (that I've called "player") from xmms.control, which itself turns out to be a metaclass.
A simple script:
from xmms import control
class hello:
__metaclass__ = control
def hellomethod(self): print "hello"
hello().hellomethod()
produces the following error:
Traceback (most recent call last):
File "hello.py", line 2, in ?
class hello:
TypeError: Error when calling the metaclass bases
'module' object is not callable
I'm presuming that xmms.control is a metaclass because if I try inheriting it with the line "class player(control):", I get error messages relating to metaclasses. Can anyone tell me what I'm doing wrong?
I've been trying to inherit a class (that I've called "player") from xmms.control, which itself turns out to be a metaclass.
A simple script:
from xmms import control
class hello:
__metaclass__ = control
def hellomethod(self): print "hello"
hello().hellomethod()
produces the following error:
Traceback (most recent call last):
File "hello.py", line 2, in ?
class hello:
TypeError: Error when calling the metaclass bases
'module' object is not callable
I'm presuming that xmms.control is a metaclass because if I try inheriting it with the line "class player(control):", I get error messages relating to metaclasses. Can anyone tell me what I'm doing wrong?