Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

It would be illogical to kill without reason. -- Spock, "Journey to Babel", stardate 3842.4


devel / comp.lang.python / Re: tail

SubjectAuthor
o Re: tailChris Angelico

1
Re: tail

<mailman.355.1652040024.20749.python-list@python.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=18196&group=comp.lang.python#18196

 copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: tail
Date: Mon, 9 May 2022 06:00:10 +1000
Lines: 17
Message-ID: <mailman.355.1652040024.20749.python-list@python.org>
References: <CABbU2U99Jpa6nuYg0sXw6=GjBEKVk9u-_oyxSoL8hLrW_2FoBA@mail.gmail.com>
<A3773CDA-B6FE-4A51-8D75-362397220F67@barrys-emacs.org>
<CABbU2U_J7HdUjDV8TLjHJkUb7xBTUes6rG0F17sDJNFX13-SNg@mail.gmail.com>
<3848780F-83B8-4B5F-BFAD-157390288C15@barrys-emacs.org>
<CABbU2U92=Xz3d2jesNZi83stnGG1XWFg7ig-=tjE5_4b_XSyzQ@mail.gmail.com>
<CAPTjJmoGC=j8dKZtgkz6O3LP+esKFMyp+hpDypPiA4jdY-rOyg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de wn+o/JFH8uRW7W/cxKRvsgieLKs/71+TXKm3X6csDS9A==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=W1+ioFoI;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.088
X-Spam-Evidence: '*H*': 0.82; '*S*': 0.00; '2022': 0.05; 'anyway,':
0.09; 'that.': 0.15; 'builtin': 0.16; 'chrisa': 0.16; 'cpython.':
0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'wrote:': 0.16; 'to:addr:python-list': 0.20; 'code': 0.23;
'sense': 0.28; 'whole': 0.30; 'approach': 0.31; 'think': 0.32;
'language.': 0.32; 'objects': 0.32; 'message-id:@mail.gmail.com':
0.32; "i'm": 0.33; 'core': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'complex': 0.35;
'from:addr:gmail.com': 0.35; 'files': 0.36; 'mon,': 0.36;
'received:209.85': 0.37; 'file': 0.38; 'way': 0.38;
'received:209': 0.39; 'seeking': 0.40; 'stated': 0.60; 'method':
0.61; 'your': 0.64; 'exactly': 0.68; 'times': 0.69; 'absolutely':
0.84; 'choices': 0.84; 'sulla': 0.84; 'doing.': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=aMHFaqRHmckaUN+NStqSSgA79aCBVDUL3zcWw6xBYSk=;
b=W1+ioFoIRPYVzuoF3zAHIhjcrxt6GDFDALnkvKeYfTX8hOfGdZK/zYLdXvYr4Ydguk
KfIwPkS+iRi8mCZxpwrjM+IBH9u7u9dKctAmrhtGgo0SlCr+N65PC3dTaRsf0LoslvQq
koG7H2P10z7r1ioOzhwcDQ3cbJTqWBi2bLXMCGlzYEZkwGPcD6XGmzPP+BxAgqvaix1Y
F6TDdTR3IDMyyXzj/TqR6oY4+k8lwyAchFtBNCRC5f8XhFl+IWCxEXDcF10ZWCGeie5a
3CmksnAlJSOLv3t2C+omALa/Z4PlzZPlUKxmWpsFO+UHIZNq+HucHP3P9nZtqjT8gWR/
KQYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=aMHFaqRHmckaUN+NStqSSgA79aCBVDUL3zcWw6xBYSk=;
b=Z3UpZX2qYp6Cafoi7O7uXiso352RK3Y29H8Ws+XzlCbHspCkzIsyepCqHIf6bKEW9c
fknA/xveRakLk9EL5xD2FC0f/gqDuSd2BvMTeadFLgA3Hk/XdN66SNdSKifuTGjYtWNo
0+jxJOCngeWYFcju3ejztjzXytKfseTx9wf6dHJa1CZtJ2vQblBye/UlLAZgDXp9cTwA
W+I9zMi6GUiHPW0EkddXgUH6h444J+ky+AHvlvMP8EoRPkOpqcF3R3NhGzpKgZSMXA1X
seZQprkGDN21AlTafhkbS0/le3CvNYsmNjiUMwDewFOJ/+6I2jPmq9Hvt3pMlp+uxhsO
c9Iw==
X-Gm-Message-State: AOAM530A0zgQecLmdFb7xPCIbETQmdyXFGYnq79BUP4jn7d6werV/YXb
ljH3oUE2bi5Aq2lsMgSWsSKdOr88qpg5pU75o6c+ZE5r
X-Google-Smtp-Source: ABdhPJxZCYpyXuAonXMIlU25kom8naFXM3khnk+tIIOZ96EZgWAA3dlCZpwyQ4T3P6dVsLaCATpgmgJtgiR42QZKVNU=
X-Received: by 2002:a5d:50c4:0:b0:20c:547d:1b4e with SMTP id
f4-20020a5d50c4000000b0020c547d1b4emr10945325wrt.160.1652040022706; Sun, 08
May 2022 13:00:22 -0700 (PDT)
In-Reply-To: <CABbU2U92=Xz3d2jesNZi83stnGG1XWFg7ig-=tjE5_4b_XSyzQ@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmoGC=j8dKZtgkz6O3LP+esKFMyp+hpDypPiA4jdY-rOyg@mail.gmail.com>
X-Mailman-Original-References: <CABbU2U99Jpa6nuYg0sXw6=GjBEKVk9u-_oyxSoL8hLrW_2FoBA@mail.gmail.com>
<A3773CDA-B6FE-4A51-8D75-362397220F67@barrys-emacs.org>
<CABbU2U_J7HdUjDV8TLjHJkUb7xBTUes6rG0F17sDJNFX13-SNg@mail.gmail.com>
<3848780F-83B8-4B5F-BFAD-157390288C15@barrys-emacs.org>
<CABbU2U92=Xz3d2jesNZi83stnGG1XWFg7ig-=tjE5_4b_XSyzQ@mail.gmail.com>
 by: Chris Angelico - Sun, 8 May 2022 20:00 UTC

On Mon, 9 May 2022 at 05:49, Marco Sulla <Marco.Sulla.Python@gmail.com> wrote:
> Anyway, apart from my implementation, I'm curious if you think a tail
> method is worth it to be a method of the builtin file objects in
> CPython.

Absolutely not. As has been stated multiple times in this thread, a
fully general approach is extremely complicated, horrifically
unreliable, and hopelessly inefficient. The ONLY way to make this sort
of thing any good whatsoever is to know your own use-case and code to
exactly that. Given the size of files you're working with, for
instance, a simple approach of just reading the whole file would make
far more sense than the complex seeking you're doing. For reading a
multi-gigabyte file, the choices will be different.

No, this does NOT belong in the core language.

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor