program to generate data helpful in finding duplicate large files

Chris Angelico rosuav at gmail.com
Thu Sep 18 14:50:54 EDT 2014


On Fri, Sep 19, 2014 at 4:45 AM, Chris Kaynor <ckaynor at zindagigames.com> wrote:
>> from stat import *
>
>
> Generally, from import * imports are discouraged as they tend to populate
> your namespace and have issues with accidentally overriding imported
> functions/variables. Generally, its more Pythonic to use the other imports
> (or import as) and reference with the namespace, as you are doing everywhere
> else. The main case where from import * is recommended is API imports (for
> example, importing the API of one module into another, such as for
> inter-platform, inter-version, or accelerator support).
>

I was going to say the same thing, except that this module
specifically is documented as recommending that. I still don't like
"import *", but either this is a special case, or the docs need to be
changed.

ChrisA



More information about the Python-list mailing list