New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subclassing from Modules #38780
Comments
In Python 2.2.3 there's a problem with accidental import MyStuff
class A(MyStuff):
pass this gives no error until you try to instantiate the o = A() TypeError: 'module' object is not callable In Python 2.3 the error is generated at module class A(MyStuff):
pass
TypeError: function takes at most 2 arguments (3 given) Since it is rather common that you create modules which |
In 2.5, the message says "module.__init__() takes at most 2 arguments (3 You get similar errors when "deriving" from other arbitrary objects, so |
I agree. Python can't stop the developer from doing stupid things. We I'm assigning the bug to our beloved dictator to ask for his opinion. |
I don't see an issue to be fixed here; adding special tests in order to Also, PEP-8 has said for years now that modules should *not* be named |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: