Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'override': 0.07; 'python': 0.09; 'terry': 0.09; 'looked': 0.10; 'library': 0.15; 'at.': 0.16; 'chaos': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'sys.path': 0.16; 'wrote:': 0.17; 'import': 0.21; 'not,': 0.21; 'installation': 0.23; "python's": 0.23; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'looks': 0.26; 'first,': 0.27; 'accidentally': 0.29; 'resolution': 0.30; 'johnson': 0.32; 'to:addr:python-list': 0.33; 'changed': 0.34; 'desirable': 0.35; 'pm,': 0.35; 'received:org': 0.36; 'message- id:@gmail.com': 0.36; 'modules': 0.36; 'problems': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'first': 0.61; 'behavior': 0.64; 'subject:Import': 0.84; 'rick': 0.91 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Fri, 11 Jan 2013 10:53:40 -0700 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121115 Thunderbird/10.0.11 MIME-Version: 1.0 To: "python-list@python.org >> python" Subject: Re: PyWart: Import resolution order References: <88bab977-ca49-487a-8fba-7d3350266d8d@googlegroups.com> In-Reply-To: <88bab977-ca49-487a-8fba-7d3350266d8d@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357926835 news.xs4all.nl 6963 [2001:888:2000:d::a6]:47782 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36634 On 01/10/2013 11:13 PM, Rick Johnson wrote: > > Python's import resolution order is terrible.[1] > > The fact that Python looks in the stdlib _first_ is not a good idea. Whether or not the default behavior is desirable or not, sys.path is set by default to look in the current directory first on any Python distribution I have looked at. As Terry says, this fact causes a lot of problems for newbies who accidentally override standard library modules with their own python files and chaos ensues. If your python installation does not search the current directory first, then you must have changed sys.path.