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


Groups > comp.lang.python > #32818

Base class and Derived class question

Received by 10.224.223.14 with SMTP id ii14mr852396qab.3.1352209623363; Tue, 06 Nov 2012 05:47:03 -0800 (PST)
Received by 10.52.37.12 with SMTP id u12mr94565vdj.8.1352209623339; Tue, 06 Nov 2012 05:47:03 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!c7no8730052qap.0!news-out.google.com!gf5ni18188417qab.0!nntp.google.com!c7no8730036qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Tue, 6 Nov 2012 05:47:03 -0800 (PST)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=90.163.62.20; posting-account=4MmJjAoAAAAh9Xp7DS1V1sLlN8hNHPkA
NNTP-Posting-Host 90.163.62.20
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <31d86df5-8cfe-46b8-ae54-84fbfd82e98e@googlegroups.com> (permalink)
Subject Base class and Derived class question
From cyberirakli@gmail.com
Injection-Date Tue, 06 Nov 2012 13:47:03 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:32818

Show key headers only | 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 : 
[CODE]class baseClass():
    def bFunction(self):
        print "We are in a base class"[/CODE]

derivedClass.py:
[CODE]import baseClass as baseClassMod
reload(baseClassMod)

class derivedClass(baseClassMod):
    def dFunction(self):
        print "We are in a derived Class" [/CODE]

buwhen I'm trying to run derivedClass.py I get this error :
[CODE][COLOR=Red]TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)[/COLOR][/CODE]

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"[/CODE]
It works fine

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:47 -0800
  Re: Base class and Derived class question Hans Mulder <hansmu@xs4all.nl> - 2012-11-06 17:33 +0100

csiph-web