Re: Having problem with subclass

2010-10-01 Thread Steven D'Aprano
On Thu, 30 Sep 2010 18:54:00 -0700, tekion wrote: > When I move Bclass to A.py, it works. Is there some restriction in > python that sub classing a class has be in the same file as the class > you're are sub classing? Thanks. Others have already solved your main problem (you need to refer to A

Re: Having problem with subclass

2010-09-30 Thread Bruce Pearson
Try: import A class Bclass(A.Aclass) ...rest of code On 1/10/2010 9:54 AM, tekion wrote: All, I have file name A.py with a class name Aclass. I have a file name B.py with sub class of Aclass, like import A class Bclass(Aclass) ...rest of code When I test it, calling B.py, I am getting: class

Re: Having problem with subclass

2010-09-30 Thread Tim Chase
On 09/30/10 20:54, tekion wrote: All, I have file name A.py with a class name Aclass. I have a file name B.py with sub class of Aclass, like import A class Bclass(Aclass) ...rest of code When I test it, calling B.py, I am getting: class Bclas(Aclass): NameError: name 'Aclass' is not defined Whe

Re: Having problem with subclass

2010-09-30 Thread Chris Rebert
On Thu, Sep 30, 2010 at 6:54 PM, tekion wrote: > All, > I have file name A.py with a class name Aclass. I have a file name > B.py with sub class of Aclass, like > import A > class Bclass(Aclass) > ...rest of code > When I test it, calling B.py, I am getting: > > class Bclas(Aclass): > NameError: n

Having problem with subclass

2010-09-30 Thread tekion
All, I have file name A.py with a class name Aclass. I have a file name B.py with sub class of Aclass, like import A class Bclass(Aclass) ...rest of code When I test it, calling B.py, I am getting: class Bclas(Aclass): NameError: name 'Aclass' is not defined When I move Bclass to A.py, it works.