NameError question - def(self,master) - master not in namespace within class?

2008-10-09 Thread harijay
Hi I am new to writing module and object oriented python code. I am trying to understand namespaces and classes in python. I have the following test case given in three files runner , master and child. I am getting an error within child where in one line it understands variable master.name and in

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread bieffe62
On 9 Ott, 17:43, harijay [EMAIL PROTECTED] wrote: Hi I am new to writing module and object oriented python code. I am trying to understand namespaces and classes in python. I have the following test case given in three files runner , master and child. I am getting an error within child where

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread Jerry Hill
On Thu, Oct 9, 2008 at 11:43 AM, harijay [EMAIL PROTECTED] wrote: Hi I am new to writing module and object oriented python code. I am trying to understand namespaces and classes in python. I have the following test case given in three files runner , master and child. I am getting an error

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread harijay
Thanks beiff for your prompt reply - But I shouldnt need to import master in child. Actually and very strangely. The problem fixed itself without any change to my code. I dont understand how. It may have been a problem with a bad *.pyc lingering around . But now I cannot get the old NameError to

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread harijay
Thanks Jerry and beiff , Jerry was right, it was an indent problem . Between using my text editor and running from commandline something went out of sync and I didnt catch it probably. I can now reproduce the error with a bad ident . These are my first posts to comp.lang.python..and I am very

Re: NameError question - def(self,master) - master not in namespace within class?

2008-10-09 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : OT bieffe, please, learn to snip irrelevant material... /OT On 9 Ott, 17:43, harijay [EMAIL PROTECTED] wrote: (snip) NameError: name 'master' is not defined (snip) #File runner.py #!/usr/bin/python import master import child if __name__==__main__: print