Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'debug': 0.03; 'happily': 0.07; 'imports': 0.07; 'terry': 0.07; 'python': 0.08; '"my': 0.09; '"no"': 0.09; '(it': 0.09; '>>>>': 0.09; 'anyway': 0.09; 'subject:file': 0.13; 'cc:addr:python-list': 0.15; '"don\'t': 0.16; '.py': 0.16; '3.2.': 0.16; 'it".': 0.16; 'reedy': 0.16; 'roy': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.16; '>>>': 0.18; '3.2': 0.18; 'jan': 0.19; 'cc:no real name:2**0': 0.21; "doesn't": 0.22; 'header:In-Reply- To:1': 0.22; '+0100,': 0.23; 'fine,': 0.23; 'globally': 0.23; 'module,': 0.23; 'subject:use': 0.24; 'cc:2**0': 0.25; 'pm,': 0.26; 'import': 0.27; 'problem': 0.29; 'cc:addr:python.org': 0.29; 'pretty': 0.30; 'usually': 0.30; 'quite': 0.31; 'tue,': 0.32; "won't": 0.33; 'it.': 0.33; 'header:User-Agent:1': 0.33; 'there': 0.33; 'someone': 0.34; 'file.': 0.34; 'probably': 0.35; "i'll": 0.35; 'file': 0.35; "he's": 0.36; 'run': 0.37; 'but': 0.37; 'unless': 0.37; 'could': 0.37; 'steven': 0.38; 'some': 0.38; 'several': 0.38; 'subject:with': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'issues': 0.40; 'huge': 0.60; 'more': 0.61; 'hope': 0.61; 'leading': 0.62; 'car': 0.66; 'buy': 0.69; 'buying': 0.81; 'failures.': 0.84; 'wheel': 0.84 X-IronPort-AV: E=Sophos;i="4.71,596,1320620400"; d="scan'208";a="118391" X-Virus-Scanned: amavisd-new at zimbra.sequans.com Date: Tue, 31 Jan 2012 15:19:13 +0100 From: Jean-Michel Pichavant User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) MIME-Version: 1.0 To: Steven D'Aprano Subject: Re: Disable use of pyc file with no matching py file References: <12592360.1754.1327959045517.JavaMail.geo-discussion-forums@vby1> <4f27d81e$0$29989$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <4f27d81e$0$29989$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328019555 news.xs4all.nl 6878 [2001:888:2000:d::a6]:53553 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19639 Steven D'Aprano wrote: > On Tue, 31 Jan 2012 11:26:10 +0100, Jean-Michel Pichavant wrote: > > >> Terry Reedy wrote: >> >>> On 1/30/2012 4:30 PM, Roy Smith wrote: >>> >>>> Every so often (typically when refactoring), I'll remove a .py file >>>> and forget to remove the corresponding .pyc file. If I then import >>>> the module, python finds the orphaned .pyc and happily imports it. >>>> Usually leading to confusing and hard to debug failures. >>>> >>>> Is there some way to globally tell python, "Never import a .pyc unless >>>> the corresponding .py file exits"? >>>> >>> Upgrade to 3.2. >>> >>> >> No. >> > > > Is that intended as "No, I won't upgrade" or "No, Python 3.2 doesn't do > the job"? > To answer Ben's mail as well, the "No" would be more of the "don't do it". My answer was as argued as Terry's one anyway (it was quite intended). Steven, you often use analogies/similarities, here's one: A: "My wheel is flat" B: "Buy a new car" Buying a new car would solve A's problem : yes Should A buy a new car : probably no Python 3.2 is fine, but someone could run into several issues while migrating. This is quite a pretty huge decision to make (I dedicate this sentence to Rick, I hope he's trolling fine). JM