Why 'import module' will not import module.py but the directorymodule?

Discussion in 'Python' started by Peng Yu, Oct 31, 2009.

  1. Peng Yu

    Peng Yu Guest

    If I have both the directory 'module' and the file 'module.py' in a
    directory in $PYTHONPATH, python will import 'module' rather than
    'module.py'. I'm wondering what is the design rationale of setting
    higher priorities to directories. Is there a way to reverse the
    priority?
    Peng Yu, Oct 31, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Opal
    Replies:
    12
    Views:
    933
    Paul Opal
    Oct 11, 2004
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    863
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,763
    Smokey Grindel
    Dec 2, 2006
  4. John Boy
    Replies:
    1
    Views:
    305
    John Machin
    Mar 10, 2008
  5. Stéphane Klein
    Replies:
    0
    Views:
    263
    Stéphane Klein
    Jul 5, 2011
Loading...

Share This Page