Python guru Fredrik Lundh has an article at 
http://effbot.org/zone/import-confusion.htm
in which he discusses use of the import statement. He says,
essentially :
   "import X" should be the normal method of importing
   "from X import *" is bad practice
   "from X import Y" is sometime ok
That seems to be the general agreement in the python world.

Some of the sample pylons applications and documentation use the "from
X import *" format. Maybe we should consider changing that over time.

For me as a newbie to Pylons, one of the drawbacks to the "from X
import *" method is that imported objects end up in the global
namespace, which makes it difficult to work out where a object comes
from (made more complex since Pylons is a "glue" framework). I think
I'd find Pylons code easier to read if objects were coded as X.<name>
rather than just plain <name>.

Anyhow, that's just a thought. I'd be interested in people's reaction
to my obervations. In the meantime, I'll continue to enjoy playing
around with Pylons.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to