Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32819

Base class and Derived class question

Newsgroups comp.lang.python
Date 2012-11-06 05:50 -0800
Message-ID <fda16cf9-38dd-49ae-9f49-92bc963aac2e@googlegroups.com> (permalink)
Subject Base class and Derived class question
From cyberirakli@gmail.com

Show all headers | View raw


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 : 
>>> class baseClass():
    def bFunction(self):
        print "We are in a base class"

derivedClass.py:
>>>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 :
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 :
>>>class derivedClass(baseClass):
    def dFunction(self):
        print "We are in a derived Class"
It works fin

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Base class and Derived class question cyberirakli@gmail.com - 2012-11-06 05:50 -0800
  Re: Base class and Derived class question Dave Angel <d@davea.name> - 2012-11-06 09:13 -0500
    Re: Base class and Derived class question cyberirakli@gmail.com - 2012-11-06 07:03 -0800
      Re: Base class and Derived class question Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-06 08:34 -0700
        Re: Base class and Derived class question cyberirakli@gmail.com - 2012-11-06 08:22 -0800
        Re: Base class and Derived class question cyberirakli@gmail.com - 2012-11-06 08:22 -0800
    Re: Base class and Derived class question cyberirakli@gmail.com - 2012-11-06 07:03 -0800
  Re: Base class and Derived class question cyberirakli@gmail.com - 2012-11-06 07:08 -0800
    Re: Base class and Derived class question alex23 <wuwei23@gmail.com> - 2012-11-06 18:10 -0800

csiph-web