Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'removes': 0.05; 'subject:file': 0.07; 'oh,': 0.09; 'sep': 0.09; 'subject:python': 0.11; 'language': 0.14; '24,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'immutable,': 0.16; 'subject:API': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'bytes': 0.17; 'integer': 0.17; 'pointer': 0.17; 'specifies': 0.17; 'equivalent': 0.20; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'forgot': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'though.': 0.29; 'file': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'guaranteed': 0.76; '100': 0.78; 'presumably': 0.84 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=vy0077GUV6ZZ3HMJRW2q8z/msxbh1AcmDnlR2f1ahLg=; b=OSRHyLT8Q4RObhIdfC9anwhQvRlUfE+DNfoXn9j6mEKhAG9+yY2mTVRvtMTzv/ZeOl Ap45sl+kGNcG4e01HewUtpLUgpaPzpgkTUT5DYJY5yHvLCydxIYX4ImE8RNqLd+c5d8Z vN+oNecyE6+kux5KT4+tEmynGW3zE8SvqM9vxqJxtY1FzpBd4ONxpOyQIRmjnTKd/mMW hLiCQIIVV305u2sd5TCiG4cv9TZzVCrAcZHCfK9GWCQ1+KVZgaztoQx96sCoc/LMEszL yAqswC9Q4Th5Wzfmj3ezmA6vYlIeTHvpvWxrRpuryXRR8IwmKt8VSaZD6B9uxHBzVy4l y9PQ== MIME-Version: 1.0 In-Reply-To: References: <0ec1fe2e-890c-4e25-8047-4cb8bee0aa95@googlegroups.com> <5060D55C.3000407@davea.name> Date: Tue, 25 Sep 2012 08:57:56 +1000 Subject: Re: python file API 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348527479 news.xs4all.nl 6982 [2001:888:2000:d::a6]:54841 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29951 On Tue, Sep 25, 2012 at 8:37 AM, Ian Kelly wrote: > On Mon, Sep 24, 2012 at 4:14 PM, Chris Angelico wrote: >> file.pos = 42 # Okay, you're at position 42 >> file.pos -= 10 # That should put you at position 32 >> foo = file.pos # Presumably foo is the integer 32 >> file.pos -= 100 # What should this do? > > Since ints are immutable, the language specifies that it should be the > equivalent of "file.pos = file.pos - 100", so it should set the file > pointer to 68 bytes before EOF. Oh, I forgot that guaranteed equivalency. Well, at least it removes the ambiguity. I don't like it though. ChrisA