Error Calling Metaclass
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you error when calling the metaclass bases module.__init__() takes at most might have Meta Discuss the workings and policies of this site
Error When Calling The Metaclass Bases Python
About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or typeerror error when calling the metaclass bases module.__init__() takes at most 2 arguments posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of
Typeerror: Error When Calling The Metaclass Bases Cannot Create A Consistent Method Resolution
4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error when calling the metaclass bases: function() argument 1 must be code, not str up vote 29 down vote favorite 1 I tried to subclass threading.Condition earlier today but it didn't work out. Here is the output typeerror: error when calling the metaclass bases function() argument 1 must be code, not str of the Python interpreter when I try to subclass the threading.Condition class: >>> import threading >>> class ThisWontWork(threading.Condition): ... pass ... Traceback (most recent call last): File "
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
Python Error When Calling The Metaclass Bases __init__
site About Us Learn more about Stack Overflow the company Business Learn
Error When Calling The Metaclass Bases Cannot Create 'nonetype' Instances
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x module.__init__() takes at most 2 arguments (3 given) htmlparser 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/2231427/error-when-calling-the-metaclass-bases-function-argument-1-must-be-code-not 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 Languages Python Programming Base class and Derived class(noob question) Thread: Base class and Derived class(noob http://forums.devshed.com/python-programming/933572-base-class-derived-class-noob-question-post2831621.html question) Share This Thread Tweet This + 1 this Post To 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 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 error when 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 "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 error when calling 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 would either have to refer to the BaseClassMod explicitly: Code: import baseClass as baseClassMod reload(BaseClassMod) class derivedClass(baseClassMod.baseClass): def dFunction(self): print "We are in a derived Class" or import the class name with an as clause: Code: from baseClass import baseClass as baseClassMod reload(BaseClassMod) class derivedClass(baseClassMod): def dFunction(self): print "We are in a derived Class" Comments on this post Cyberika agrees : Realy elpfull post! Thank you! Rev First Speaker Schol-R-LEA;2 JAM LCF ELF KoR KCO BiWM TGIF #define KINSEY (rand() % 7) λ Scheme is the Red Pill Scheme i