Uninformative error message about subclassing

Here are two small python files: ---- a.py: class A(object): pass ---- b.py: import a class B(a): pass ---- If I run "python b.py" I get the uninformative error message: Traceback (most recent call last): File "./b.py", line 5, in ? class B(a): TypeError: function takes at most 2 arguments (3 given) I think the message should say that "a" is not a class.

--On Montag, 31. Mai 2004 16:22 Uhr +0200 Andreas Jung <lists@andreas-jung.com> wrote:
--On Montag, 31. Mai 2004 10:13 Uhr -0400 "Edward C. Jones" <edcjones@erols.com> wrote:
Here are two small python files:
---- a.py:
class A(object): pass
---- b.py:
import a
class B(a): pass
You are trying to use *module a* as base class? Weird idea.
Forget my reply. I have misread your posting. -- Andreas Jung -------------------------------- www.zopyx.com Software-Entwicklung und Consulting Andreas Jung

On Mon, May 31, 2004, Edward C. Jones wrote:
---- a.py:
class A(object): pass
---- b.py:
import a
class B(a): pass ---- If I run "python b.py" I get the uninformative error message:
Traceback (most recent call last): File "./b.py", line 5, in ? class B(a): TypeError: function takes at most 2 arguments (3 given)
I think the message should say that "a" is not a class.
Please file a bug report on SF. However, I suspect this will be tricky to solve (if it's even possible), because of the way builtin objects are now part of new-style classes. (That A is a new-style class is irrelevant.) -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "as long as we like the same operating system, things are cool." --piranha
participants (3)
-
Aahz
-
Andreas Jung
-
Edward C. Jones