os,access argument problem

Matthew Dixon Cowles matt at mondoinfo.com
Sun Aug 20 23:50:11 EDT 2000


On Sun, 20 Aug 2000 17:05:52 -0700, Bob van der Poel
<bvdpoel at uniserve.com> wrote:

[snip]

>Ahh... actually, I'd tried os.access("foo", F_OK) and using a string
>was an act of desperation. Never occurred that I'd have to use
>os.F_OK. I'm wondering if it makes more sense to 'from os import *',
>or should I learn to do it this way?

You should learn to do it this way. Here's why: if you do

from foo import *

eventually you will import something that shadows another name. Either
you'll import a module that has an function that has the same name as
one of the builtins or you'll import two modules that each has
something of the same name. Those bugs are a nuisance to find.

>Thanks!

You're welcome.

Regards,
Matt



More information about the Python-list mailing list