In Python 2.3, subclassing from bool resulted in:
>>> class Test(bool): pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: type 'bool' is not an acceptable base type
In Python2.4a3 (latest CVS), it results in:
>>> class Test(bool): pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: Error when calling the metaclass.
Make sure the base arguments are valid.
Interestingly, also in Python 2.4a3:
>>> type("foo", (bool,), {})
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: type 'bool' is not an acceptable base type
I think it is a bug, and the error message should be
'not an acceptable base type'. Apart from that, I don't
see why it is not an acceptable base type, but that's a
different issue.
|