Error When Calling The Metaclass Bases Takes At Most
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or error when calling the metaclass bases takes at most 2 arguments posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss error when calling the metaclass bases module.__init__() takes at most 2 arguments Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) takes a minute: Sign up Python strange exception. Have I found my first Python bug or is this a noob mistake? up vote 18 down vote favorite 2 Let me start by saying, I also get the same error whey typeerror error when calling the metaclass bases module.__init__() takes at most 2 arguments defining __init__ and running super()'s __init__. I only simplified it down to this custom method to see if the error still happened. import HTMLParser class Spider(HTMLParser): """ Just a subclass. """ This alone in a module raises the following error: Traceback (most recent call last): File "D:\my\path\to\my\file class Spider(HTMLParser): TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) python share|improve this question edited Jul 5 '15 at 13:07 asked Feb 12 '10 at 17:39 orokusaki
Typeerror Error When Calling The Metaclass Bases Object() Takes No Parameters
17.2k26107191 10 Who voted to close? Just because this question is easy to answer, doesn't mean that it is warrant-less. Python's exception clearly wasn't very helpful. You should not subclass a module so Python might be better to say "This error is caused by incorrectly sub-classing a module". After all, it is not a noob mistake to have a typo or import mistake. –orokusaki Feb 12 '10 at 17:48 1 There shout be a definnetly better debug message. –Sebastian Piskorski Sep 14 '14 at 12:03 add a comment| 1 Answer 1 active oldest votes up vote 32 down vote accepted And the answer is that I'm a complete noob. This is a module, not a class, but I'll leave this up here in case other noobs run into the same problem. Solution: from HTMLParser import HTMLParser Each time I think I'm starting to become a pro, something like this happens :( share|improve this answer answered Feb 12 '10 at 17:41 orokusaki 17.2k26107191 3 I don't know, I could actually see this tripping up a lot of people, having the module and the class within the module named the same. –BigBeagle Feb 12 '10 at 17:44 6 I think there's a quite a range of existence between complete noob and pro. –MattH Feb 12 '10 at 17:48 (deleted a set of comments with multiple flags from multiple users; off-topic to the question) –Marc Gravell♦ Feb 12
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this
Error When Calling The Metaclass Bases Function() Argument 1 Must Be Code Not Str
site About Us Learn more about Stack Overflow the company Business Learn error when calling the metaclass bases python more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question error when calling the metaclass bases cannot create a consistent method resolution x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error http://stackoverflow.com/questions/2253816/python-strange-exception-have-i-found-my-first-python-bug-or-is-this-a-noob-mis when calling the metaclass bases up vote 0 down vote favorite Finding it very difficult to wrap around this basic problem. I'm using python 2.7.10 to follow a flask tutorial being delivered using python 3.4. I'm aware of some differences between the two versions, but seems that knowledge isn't enough to overcome this situation. I have amateur level experience in python. Have a feeling http://stackoverflow.com/questions/37432165/error-when-calling-the-metaclass-bases its got something to do with class definition, but unable to nail it. And yes i went through the solutions for similar error but wasn't able to relate the solution to my problem. Traceback (most recent call last): File "manage.py", line 5, in
Search Username Password Remember Me? Register Lost Password? facebook google twitter rss Free Web Developer Tools Advanced Search Forum Programming http://forums.devshed.com/python-programming/933572-base-class-derived-class-noob-question-post2831621.html Languages Python Programming Base class and Derived class(noob question) Thread: Base class and Derived class(noob question) Share This Thread Tweet This + 1 this Post To https://bytes.com/topic/python/answers/42799-metaclass-error Linkedin Subscribe to this Thread Subscribe to This Thread November 6th, 2012,07:00 AM #1 No Profile Picture Cyberika View Profile View Forum Posts error when Registered User Devshed Newbie (0 - 499 posts) Join Date Nov 2012 Posts 2 Rep Power 0 Base class and Derived class(noob question) Hey guys, I'm trying to understand how is working base class and derived class. So, I have to files baseClass.py and derivedClass.py. baseClass.py : Code: class baseClass(): def bFunction(self): print error when calling "We are in a base class" derivedClass.py: Code: import baseClass as baseClassMod reload(baseClassMod) class derivedClass(baseClassMod): def dFunction(self): print "We are in a derived Class" buwhen I'm trying to run derivedClass.py I get this error : Code: TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) Interesting thing is that if I run baseClass.py and then run : Code: class derivedClass(baseClass): def dFunction(self): print "We are in a derived Class" It works fine Faq Reply With Quote November 6th, 2012,08:51 AM #2 Schol-R-LEA View Profile View Forum Posts Commie Mutant Traitor Devshed Intermediate (1500 - 1999 posts) Linkedin Join Date Jun 2004 Location Alpharetta, GA Posts 1,809 Rep Power 1572 The issue is that you are changing the name of the imported module, but not the imported class. In order to do what you seem to want, you wo
& solutions from a community of 418,547 IT Pros & Developers. It's quick & easy. metaclass error P: n/a asteele dear readers, i have a very simple package organized as follows: !-----------------------------------------! bgp/ __init__.py managers/ __init__.py ManagerInterface.py TestManager.py !-----------------------------------------! and here's ManagerInterface.py and TestManager.py: !-----------------------------------------! # ManagerInterface.py class ManagerInterface(object): def __init__(self): pass def process(self, recset, operation): print 'In ManagerInterface.process()...' # TestManager.py import ManagerInterface class TestManager(ManagerInterface): def process(self, recset, operation): print 'In TestManager.process()...' super(TestManager,self).process(recset,operation) !-------------------------------------------! when i try to import the TestManager module via the interpreter, i get the following error: !-------------------------------------------! $ python Python 2.4.1c1 (#1, Mar 14 2005, 10:28:18) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-49)] on linux2 import bgp.managers.TestManager Traceback (most recent call last): File "