Python Forum

Full Version: annoying conflict: stat
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
in a module i created to collect lots of different things i do, i ended up with:
import stat
from os import stat
they were not in the same place and the 2nd one also had lots of other functions. but at least both were in the same file. and things got even worse in my current project where the pattern of variable names i was using made sense to use stat as one of the names. but at least all the confusion with that led to the discovery of the conflict in that file. now to figure out the best way to resolve this.
Always put all of your imports at the top of the file.
i did. there were so many in that one file that they were several lines apart. all the straight imports were first, followed by all the "from" imports.