On 01/02/2013 11:30 PM, Andrew Berg wrote:
On 2013.01.02 15:57, Michael Torrie wrote:
*. The only place where I've seen an import * that actually belonged
was in an __init__.py that brought sub-module symbols into the main
package namespace, and even then I figure there's got to be a better way.
This.
I have some code that imports multiprocessing.connection and I do
actually type out multiprocessing.connection.Client and it doesn't
bother me one bit. Code is read a lot more than it is written, even if
only one person ever sees it. The whole "less typing" thing is absurd,
especially when IDEs have completion features and stdlib modules share
Until about a week ago, actually I hadn't setup emacs to use code
completion - maybe this will change now because it'll speed things up
and code completion is just a wonderful thing making things easier +
quicker to do. I also setup emacs to do use TAGS and a lot more things now.
similar or exact function names (is it subprocess.Popen or os.popen? I
guess the author wanted to save 2 seconds typing while anyone who reads
it has to spend 5-10 to find out which is being used) . I've been using
Well, this is not a problem for opengl-commands, I think... Normally I
do as you suggest and for the exact same reasons as you write.
full namespaces since I started learning Python, and I even do it at the
interactive interpreter because it's just a habit. IMO, "from foo import
*" should only ever be used for /intentional/ namespace pollution (and
even then, there are probably better ways to do it).
But I don't do any pollution - only this "format", which was a false
alert. And so far I'm so consequent to only use it for the
opengl-commands. I would deem that this is what most opengl-programmers do.
Try to search for opengl-code out there on the internet... Most people
do as I write I do here, IMHO. But you have a point and generally I
totally agree with you. This is just a particular exception (and the
only one I have) where I disagree, because I do as I think the majority
of opengl-programmers do - based on what I see posted on the internet.
--
http://mail.python.org/mailman/listinfo/python-list