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.

Author lemburg
Recipients
Date 2003-07-03.10:32:45
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
In Python 2.2.3 there's a problem with accidental 
subclassing from a Python module, e.g.

import MyStuff

class A(MyStuff):
     pass

this gives no error until you try to instantiate the
class:

o = A()

TypeError: 'module' object is not callable

In Python 2.3 the error is generated at module 
startup time:

class A(MyStuff):
     pass
TypeError: function takes at most 2 arguments (3 given)

Since it is rather common that you create modules which
have the same name as their most important class, I
would find it more appropriate to raise a TypeError
with a message "can't subclass a module instance"
in both versions.


History
Date User Action Args
2007-08-23 14:14:30adminlinkissue765228 messages
2007-08-23 14:14:30admincreate