Re: redefining a function through assignment

2005-09-09 Thread Peter Hansen
> Daniel Britt wrote: > >> I am new to Python so if there is an obvious answer to my question >> please forgive me. Lets say I have the following code in mod1.py >> >> class test: >>def func1(self): >> print 'hello' >> >> >> Now lets say I have another file called main.py: >> >> import

Re: redefining a function through assignment

2005-09-09 Thread Terry Hancock
On Thursday 08 September 2005 06:56 pm, Daniel Britt wrote: > This will print out 'new method'. If any other instance of mod1.test is > created calling func1, func1 will always reference the newFunc function. > This is less than desirable to say the least. Well, actually it's very desireable, bu

Re: redefining a function through assignment

2005-09-08 Thread Michael Spencer
Daniel Britt wrote: > Hello All, > I am new to Python so if there is an obvious answer to my question please > forgive me. Lets say I have the following code in mod1.py > > class test: > def func1(self): > print 'hello' > > > Now lets say I have another file called main.py: > > import mod1 >

redefining a function through assignment

2005-09-08 Thread Daniel Britt
Hello All, I am new to Python so if there is an obvious answer to my question please forgive me. Lets say I have the following code in mod1.py class test: def func1(self):   print 'hello' Now lets say I have another file called main.py: import mod1 inst = mod1.tes