Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.albasani.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'position,': 0.04; 'subject:file': 0.07; 'sep': 0.09; 'subject:python': 0.11; 'f.tell()': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'naive': 0.16; 'subject:API': 0.16; 'tape': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'driver': 0.17; 'followed': 0.20; 'all,': 0.21; 'delta': 0.22; 'absolute': 0.23; 'specified': 0.23; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'smart': 0.29; 'trigger': 0.29; 'relative': 0.30; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'but': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'between': 0.63; '26,': 0.65; 'dennis': 0.91; 'technique': 0.93 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=2lZaPu0H7NSprDhlje0V9PsA2ffiuLWQywrw6DVfPCw=; b=VBaZmInbeS6Dz8q1z8YL9N5JDGcVy7fpB3g5Zz+H2NjbWHyzIEMn/zxq/KqIK7a9uv 1JALNlAql0qLj9P7S22k1coCC5nIceMXKqDgTzf0W2t0VpECgJOh4MnERISaitg5/TGv D2smtACwLHwu+pLWWtFaN7Kf4vHLDcP7vU67ZQbsxykzpwoJ5idLj+EI6YigsScLtFRL X2RpfAbHVrx75Cvl8eM4qL3WznpTzVLS8QfxU+FWitHvTG2Lw5Zt3AsC4ht7QDzfhzYE j4juU04rDgTu2SlPyxuSZmAU5FX7bHOZw6XKF15shRwSMx0+Yg7uZ9cvCIcIygNjtvIc ST4A== MIME-Version: 1.0 In-Reply-To: <5cl3685bv3a2gidce2fn64grjtk9ch7kp5@invalid.netcom.com> References: <0ec1fe2e-890c-4e25-8047-4cb8bee0aa95@googlegroups.com> <60q268tnj9mqhvdtlehv59ob9bvpf8lgjr@invalid.netcom.com> <5cl3685bv3a2gidce2fn64grjtk9ch7kp5@invalid.netcom.com> Date: Wed, 26 Sep 2012 02:12:09 +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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348589539 news.xs4all.nl 6927 [2001:888:2000:d::a6]:36404 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30106 On Wed, Sep 26, 2012 at 2:07 AM, Dennis Lee Bieber wrote: > f.pos += delta > > would be a "seek.set" and with a naive driver might trigger a rewind to > the start of the tape followed by a seek to the absolute position, > whereas the seek from current location would only move the tape by the > specified amount... But a smart driver should always optimize the absolute seek to a relative seek, unless there's a hard difference between them. After all, the standard "read-ahead" technique is going to do an absolute seek: opaque_value = f.tell() f.read(blah blah blah) f.seek(opaque_value) ChrisA