This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Confusing error message when subclassing from invalid base
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: mwh Nosy List: gerrit, mwh
Priority: normal Keywords:

Created on 2004-09-11 10:13 by gerrit, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg22429 - (view) Author: Gerrit Holl (gerrit) Date: 2004-09-11 10:13
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.
msg22430 - (view) Author: Gerrit Holl (gerrit) Date: 2004-09-11 10:15
Logged In: YES 
user_id=13298

This seems to be related to:

[ 1014215 ] Unspecific errors with metaclass
http://www.python.org/sf/1014215
msg22431 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-09-12 14:22
Logged In: YES 
user_id=6656

Yeah, it's the same.  Closing as duplicate.
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40899
2004-09-11 10:13:34gerritcreate