[ python-Bugs-1026269 ] Confusing error message when subclassing from invalid base

SourceForge.net noreply at sourceforge.net
Sun Sep 12 16:22:31 CEST 2004


Bugs item #1026269, was opened at 2004-09-11 11:13
Message generated for change (Comment added) made by mwh
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1026269&group_id=5470

Category: Python Interpreter Core
Group: Python 2.4
>Status: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Gerrit Holl (gerrit)
>Assigned to: Michael Hudson (mwh)
Summary: Confusing error message when subclassing from invalid base

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Michael Hudson (mwh)
Date: 2004-09-12 15:22

Message:
Logged In: YES 
user_id=6656

Yeah, it's the same.  Closing as duplicate.

----------------------------------------------------------------------

Comment By: Gerrit Holl (gerrit)
Date: 2004-09-11 11:15

Message:
Logged In: YES 
user_id=13298

This seems to be related to:

[ 1014215 ] Unspecific errors with metaclass
http://www.python.org/sf/1014215


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1026269&group_id=5470


More information about the Python-bugs-list mailing list