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: Bad error mesage when subclassing a module
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: edcjones, rhettinger
Priority: normal Keywords:

Created on 2004-06-01 02:18 by edcjones, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg20943 - (view) Author: Edward C. Jones (edcjones) Date: 2004-06-01 02:18
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.
msg20944 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-06-05 06:17
Logged In: YES 
user_id=80475

Fixed.
See Python/ceval.c 2.398.

Thanks for the report.
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40317
2004-06-01 02:18:03edcjonescreate