[ python-Bugs-963956 ] Bad error mesage when subclassing a module

SourceForge.net noreply at sourceforge.net
Mon May 31 22:18:03 EDT 2004


Bugs item #963956, was opened at 2004-06-01 02:18
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=963956&group_id=5470

Category: Type/class unification
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Edward C. Jones (edcjones)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bad error mesage when subclassing a module

Initial Comment:
I made a common mistake and ended up trying to subclass
a module. Here are two small python files:

----
a.py:

class a(object):
    pass

----
b.py:

import a

class B(a):  # Should be "a.a".
    pass
----
If I run "python b.py" I get the uninformative error
message:

Traceback (most recent call last):
  File "./b.py", line 3, 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.


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

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



More information about the Python-bugs-list mailing list