Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'executable': 0.07; 'python': 0.09; 'directory)': 0.09; 'path.': 0.09; 'unexpected': 0.09; 'unix,': 0.09; 'cares': 0.16; 'demonstrable': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'windows': 0.19; 'module': 0.19; 'import': 0.21; 'explicit': 0.22; 'header:In-Reply-To:1': 0.25; 'looks': 0.26; 'module.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'options': 0.27; 'fri,': 0.30; 'code': 0.31; 'point': 0.31; 'johnson': 0.32; '11,': 0.33; 'to:addr:python-list': 0.33; 'likely': 0.33; 'received:google.com': 0.34; 'follows:': 0.35; 'path': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'anything': 0.36; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'list,': 0.39; 'header:Received:5': 0.40; 'back': 0.62; 'policy': 0.62; 'more': 0.63; '2013': 0.84; 'first?': 0.84; 'holes': 0.84; 'subject:Import': 0.84; 'yet?': 0.84; 'rick': 0.91; 'hand,': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=10ZXeiCAxjoSTYzzZdgeJk+Wp8hIJ/i3TznVbpezYQw=; b=sHPNnancECCwBhcX7W0hQNDEb1PvRgiQCepZxF6ey/VlcmIeP26BiagCnwefN6FWuF V9oVMg7k6Cg6ash6Fc2diWiAAIP3grcqsyFeJl6/zOeKx7Z1Q7fpeoEWBrsGH4NS/x+t rHX+CZFupw6r39IQQP5KhrYxLMuso7RCH/X8VIDW4JDdLu3kslfwQrvT6YL5ShE1sSEP XQEmws523TaKkWZPStoriXtoMkA7dC2uvicBCO6Sr1035HbbF5nAguOoIRpMePupXQ93 tFX4296E5c4coNQe33ayUoKxkiGR5mDi/mrA5JXGFNAedqktrNkoHuzUXiSb8qjbh2C5 F9hQ== MIME-Version: 1.0 In-Reply-To: <88bab977-ca49-487a-8fba-7d3350266d8d@googlegroups.com> References: <88bab977-ca49-487a-8fba-7d3350266d8d@googlegroups.com> Date: Fri, 11 Jan 2013 17:30:27 +1100 Subject: Re: PyWart: Import resolution order From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357886143 news.xs4all.nl 6931 [2001:888:2000:d::a6]:35728 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36607 On Fri, Jan 11, 2013 at 5:13 PM, Rick Johnson wrote: > The fact that Python looks in the stdlib _first_ is not a good idea. It would seem more intuitive for a custom "math" module (living in the current directory) to /override/ the stlib "math" module. The proper order is as follows: > > 1. Current package or directory > 2. stdlib > 3. under the bed > 4. who cares at this point Why is it better to import from the current directory first? Windows has that policy for executable commands; Unix, on the other hand, requires that you put an explicit path for anything that isn't in the standard search path. Which of these options is the more likely to produce security holes and/or unexpected behaviour? Welcome back to the list, Rick. Got any demonstrable code for Python 4000 yet? ChrisA