Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
annoying conflict: stat
#1
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.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Always put all of your imports at the top of the file.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
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.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  where is documentation for stat result attributes in PDF docs? Skaperen 5 999 May-18-2023, 07:24 PM
Last Post: Skaperen
  doc for os.stat() lacks exceptions Skaperen 1 2,616 Feb-21-2021, 09:25 AM
Last Post: Larz60+
  arg and keyword arg conflict: what to raise Skaperen 5 2,705 Jun-22-2020, 12:43 AM
Last Post: Skaperen
  venv conflict at shell prompt Skaperen 3 2,787 Feb-21-2019, 02:18 AM
Last Post: Larz60+
  import time conflict Skaperen 2 2,813 Oct-15-2017, 07:44 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020