Re: del an imported Class at EOF... why?

2009-10-08 Thread Terry Reedy
Simon Forman wrote: On Thu, Oct 8, 2009 at 1:42 AM, Terry Reedy tjre...@udel.edu wrote: Hans Mulder wrote: Errrhm, no. He is not deleting the PyQt4 module from sys.modules; he's only deleting the name QtGui from his own namespace. Next time Python comes across from PyQt4 import QtGui ,

Re: del an imported Class at EOF... why?

2009-10-08 Thread Terry Reedy
Terry Reedy wrote: Hans Mulder wrote: Errrhm, no. He is not deleting the PyQt4 module from sys.modules; he's only deleting the name QtGui from his own namespace. Next time Python comes across from PyQt4 import QtGui , it finds that the module PyQt4 already exists in sys.modules, so

Re: del an imported Class at EOF... why?

2009-10-07 Thread Ryan
Thanks everyone for your insight. I'm going to have to agree with the paranoid desire to prevent people importing his module and then using the classes he imports from elsewhere (I'm not ruling out the lead paint theory until I can gather more evidence). It does beg the question for me. Consider

Re: del an imported Class at EOF... why?

2009-10-07 Thread Stephen Hansen
On Wed, Oct 7, 2009 at 2:31 AM, Ryan heni...@yahoo.com wrote: Next time python comes across from PyQt4 import QtGui it would have to re-import the class, which seems a waste of cycles that could accumulate. Python only imports modules once. The next time Python comes across that, it looks

Re: del an imported Class at EOF... why?

2009-10-07 Thread Hans Mulder
Ryan wrote: [] It does beg the question for me. Consider the example from his code below from PyQt4 import QtGui class LauncherWidget( QtGui.QWidget ): # A Specialization of QWidget del QtGui Next time python comes across from PyQt4 import QtGui it would have to re-import the

Re: del an imported Class at EOF... why?

2009-10-07 Thread Carl Banks
On Oct 7, 2:31 am, Ryan heni...@yahoo.com wrote: Thanks everyone for your insight. I'm going to have to agree with the paranoid desire to prevent people importing his module and then using the classes he imports from elsewhere (I'm not ruling out the lead paint theory until I can gather more

Re: del an imported Class at EOF... why?

2009-10-07 Thread Steven D'Aprano
On Wed, 07 Oct 2009 02:31:00 -0700, Ryan wrote: Thanks everyone for your insight. I'm going to have to agree with the paranoid desire to prevent people importing his module and then using the classes he imports from elsewhere (I'm not ruling out the lead paint theory until I can gather more

Re: del an imported Class at EOF... why?

2009-10-07 Thread Terry Reedy
Hans Mulder wrote: Errrhm, no. He is not deleting the PyQt4 module from sys.modules; he's only deleting the name QtGui from his own namespace. Next time Python comes across from PyQt4 import QtGui , it finds that the module PyQt4 already exists in sys.modules, so Python does not have to

del an imported Class at EOF... why?

2009-10-06 Thread Ryan
Good day all! I've just inherited a large amount of python code. After spending some time pour through the code, I've noticed that the original developer (who is no longer w/ the company) constantly deletes the imported classes at the end of the .py file. Why would one want to do such a thing?

Re: del an imported Class at EOF... why?

2009-10-06 Thread Carl Banks
On Oct 6, 10:56 am, Ryan heni...@yahoo.com wrote: Good day all! I've just inherited a large amount of python code. After spending some time pour through the code, I've noticed that the original developer (who is no longer w/ the company) constantly deletes the imported classes at the end of

Re: del an imported Class at EOF... why?

2009-10-06 Thread Dave Angel
Carl Banks wrote: On Oct 6, 10:56 am, Ryan heni...@yahoo.com wrote: Good day all! I've just inherited a large amount of python code. After spending some time pour through the code, I've noticed that the original developer (who is no longer w/ the company) constantly deletes the imported

Re: del an imported Class at EOF... why?

2009-10-06 Thread Steven D'Aprano
On Tue, 06 Oct 2009 10:56:26 -0700, Ryan wrote: Good day all! I've just inherited a large amount of python code. After spending some time pour through the code, I've noticed that the original developer (who is no longer w/ the company) constantly deletes the imported classes at the end of