[reportlab-users] Two Generic Questions

Tim Roberts timr at probo.com
Tue Oct 30 18:22:50 EDT 2007


Rich Shepard wrote:

> On Tue, 30 Oct 2007, Tim Roberts wrote:

>

>> That's just good Python practice. Almost any time you see this:

>>

>> from anothermodule import *

>>

>> it is a bad practice.

>

> Hmmm-m-m. There seems to be nothing wrong with

> import wx

> or

> import matplotlib

>

> but, I'll accept your explanation, Tim.


Exactly right. Those represent the RIGHT way to do things. "import
wx" brings in exactly one name into my global namespace. Until very
recently, most wxPython applications started out
from wx import *
which brought in THOUSANDS of new names directly into my global namespace.

With the new method, I say:
class MyApplication( wx.App ):
With the old method, I said:
class MyApplication( wxApp ):

Now, the naming convention gave you a very good hint, but you could not
grep for wxApp and know with certainty where it came from. With the new
method, I can search for wx and find its import.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list