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


Groups > comp.lang.python > #32825

Re: Base class and Derived class question

Newsgroups comp.lang.python
Date 2012-11-06 07:03 -0800
References <fda16cf9-38dd-49ae-9f49-92bc963aac2e@googlegroups.com> <mailman.3324.1352211254.27098.python-list@python.org>
Subject Re: Base class and Derived class question
From cyberirakli@gmail.com
Message-ID <mailman.3327.1352214191.27098.python-list@python.org> (permalink)

Show all headers | View raw


> in what Python version ?

 Python 2.7.3
 

> How did all those angle brackets get into the file?  Are you confusing
> 
> an interactive interpreter session with running source files?

I've used angle brackets just for posting here,becauze this forum doesn't support [code][/code]

I have a file called baseClass.py with code abouve and indentation is correct.
Then I open  python IDLE and type :
import baseClass as baseClassMod
reload(baseClassMod

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

After that i get the error above. But if I paste in Python IDLE a code from baseClass.py and just run:
class derivedClass(baseClass):
    def dFunction(self):
        print "We are in a derived Class"

it works perfectly. 
Why happen this? 

Back to comp.lang.python | Previous | NextPrevious in thread | Next 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