Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Ahead warp factor one, Mr. Sulu.


devel / comp.lang.python / RE: Extract lines from file, add to new files

SubjectAuthor
o RE: Extract lines from file, add to new files<avi.e.gross

1
RE: Extract lines from file, add to new files

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From:
Newsgroups: comp.lang.python
Subject: RE: Extract lines from file, add to new files
Date: Sun, 14 Jan 2024 10:21:50 -0500
Lines: 59
Message-ID: <mailman.37.1705245714.15798.python-list@python.org>
References: <5a6d88e-46b1-a3ea-333-d053cbe5654d@appl-ecosys.com>
<24aeb00e-41fd-4809-ae96-d429645cbc07@mrabarnett.plus.com>
<4a215b7d-f1af-49d7-1496-96e290255314@appl-ecosys.com>
<65A0E32A.2458.26DB92@RealGrizzlyAdams.vivaldi.net>
<CAJQBtgnNs6q_+MrPsir4Kioh8Zra+UepDiwx61c0NXcm3P3xOw@mail.gmail.com>
<76935eb3-ed67-428e-9aea-a8e527e12914@DancesWithMice.info>
<CAPTjJmqc6g9oBLMh9Mt6K5ozN+xUJJJ68TjHBHnMXAS62mydew@mail.gmail.com>
<CAJQBtg=+_46_NDqYcpbf+heO4RjStvpJOuui9wgKmiEDinS9jg@mail.gmail.com>
<CAPTjJmrvUxenuBptvTDKiXptnzvLZQRhhYR_nuRTGibE5LaB3Q@mail.gmail.com>
<026f01da46fd$65fc1360$31f43a20$@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de dTKloq01yIUSJbt195vBwwy4Fttd4zifUyrJLKf0HK2Q==
Cancel-Lock: sha1:m97Hr0knuFQnjaWMvhBScjoYxDo= sha256:EKRBTa34XONjyNeO+LFrsxqWkHTFoi0h3EYMMb0k9RM=
Return-Path: <avi.e.gross@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=cUiwi/4w;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.025
X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'looks': 0.02; 'bunch':
0.05; 'variable': 0.05; 'loop': 0.07; 'received:mail-
qk1-x72d.google.com': 0.07; 'subject:add': 0.07; 'sun,': 0.07;
'angelico': 0.09; 'choice.': 0.09; 'originally': 0.09;
'received:108': 0.09; 'sometimes,': 0.09; 'subject:files': 0.09;
'url:mailman': 0.15; 'supported': 0.15; '2024': 0.16; 'aside':
0.16; 'chrisa': 0.16; 'context.': 0.16; 'indeed': 0.16; 'purely':
0.16; 'ways.': 0.16; 'wrote:': 0.16; 'python': 0.16; 'instead':
0.17; 'message-id:@gmail.com': 0.18; 'name.': 0.19; 'to:addr
:python-list': 0.20; 'all,': 0.20; 'language': 0.21;
'subject:file': 0.22; 'lines': 0.23; 'anything': 0.25; 'skip:-
10': 0.25; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'python,': 0.25; 'url:listinfo': 0.25;
'cannot': 0.25; 'url-ip:188.166/16': 0.25; 'object': 0.26;
"isn't": 0.27; 'bit': 0.27; 'function': 0.27; 'chris': 0.28;
'example,': 0.28; 'it,': 0.29; 'seem': 0.31; 'url-ip:188/8': 0.31;
'program': 0.31; 'extract': 0.32; 'keyword': 0.32; 'objects':
0.32; 'python-list': 0.32; 'but': 0.32; 'there': 0.33; 'someone':
0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'yes,': 0.35; 'from:addr:gmail.com': 0.35; 'files': 0.36; 'built':
0.36; 'possibly': 0.36; 'main': 0.37; 'subject:from': 0.37;
'using': 0.37; "it's": 0.37; 'way': 0.38; 'could': 0.38; 'put':
0.38; 'considering': 0.39; 'break': 0.39; 'method': 0.61; 'from:':
0.62; 'to:': 0.62; 'seen': 0.62; 'simply': 0.63; 'definition':
0.64; 'extend': 0.64; 're:': 0.64; 'reserve': 0.64; 'similar':
0.65; 'well': 0.65; 'worked': 0.67; 'live': 0.68; 'right': 0.68;
'items': 0.68; 'order': 0.69; 'and,': 0.69; 'hybrid': 0.69;
'oriented': 0.69; 'perfectly': 0.69; 'pressure': 0.69; 'january':
0.71; 'head': 0.73; 'hundreds': 0.75; 'languages,': 0.76; 'sent:':
0.78; 'left': 0.83; 'choices': 0.84; 'conceived': 0.84; 'grew':
0.84; 'method,': 0.84; 'seamlessly': 0.84; 'tiny': 0.84; 'behind':
0.88; 'beauty': 0.91; 'grammar': 0.91; 'keywords': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1705245712; x=1705850512; darn=python.org;
h=thread-index:content-language:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:from:to:cc:subject:date:message-id:reply-to;
bh=nn7Rah/A1okFr60eL36cyOjAUlgkJGE9bUQL1S+ZYII=;
b=cUiwi/4wT4e1eliVPyttFZ9UEGxVJUucEr59W/iuZm9cLxiqt3eJJRWvCxwVsydktq
ettGIRhpA7wv2scG0v1A4xZZNTySAUu6K8/gbAAcGy/ZoNhKXI0TJwK9GEL/vMwl6sts
YkbJ3jWwNIsmmXvdQUJ0YnSCKQSYmaunkcqrI22it6ctRazOyCJf25bh6hUp0ggab9wb
pfYyJZItZ6svf3+O7JqLI8X5ibqi3qBJMTWopmDmiP23LUlIKoNsSL2UTZR9XjNGb0sm
Gv9sfsrFJcT+6ZOovH+X0etK6XzU/DLQtBe/samsf0P1g43NDZJY2vdDOuiC1o/j+G9U
kIOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1705245712; x=1705850512;
h=thread-index:content-language:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=nn7Rah/A1okFr60eL36cyOjAUlgkJGE9bUQL1S+ZYII=;
b=qSkNmi1lA9iqHaYBv/QsehVj0W/b3wlSCIlyr68ZLqX058H0sWGqEOQmEO9Uv6oocT
fDYs4sZXX45xfKLX+HH/N+GhcKJLvxXWVLNABoe2wOSBwfEM7UEZJ9zqdDpRlamBU6Na
LuVPoyZIB15EdWeIGMCsWEj+pUewGJJ8bQ3b8wSQTFezbWuP1iFLqibkBBRXWjHEDz5m
u4IcHXZgMHr2k8mbZJHC0f5Rs44r/ioGogVe9/tuyaBNUjn0Ib99aRcjjt4cfwKRrUEd
gwNJTrFzNmLPVReTVI38GWQJRlV9vhBkcH/c6YVv9VAFCw+0jURcsVWB/5tDsTEL2yA3
GVxQ==
X-Gm-Message-State: AOJu0YyEMvqbX9DaIA9Vqco9BMhFWxaXkwVf5L2G+JN/IY3HORAKqnGY
AfEtoif3EdHMXbyNNx0S/IGQT/eAop4=
X-Google-Smtp-Source: AGHT+IFv38XfLdUNgbEr92warCdHUePsO733ouoNEPRGHn0ni/mmkbatT1OIBfHa+OKgUXhhMGjdNw==
X-Received: by 2002:ae9:c00b:0:b0:783:3571:1d95 with SMTP id
u11-20020ae9c00b000000b0078335711d95mr5235629qkk.48.1705245711936;
Sun, 14 Jan 2024 07:21:51 -0800 (PST)
In-Reply-To: <CAPTjJmrvUxenuBptvTDKiXptnzvLZQRhhYR_nuRTGibE5LaB3Q@mail.gmail.com>
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQIEz66WMm6MZC7NmeSpotZqvFCmzQI47IbGAgE6auYCCAMH4QLr/UPCAqzHqrMB3Q2fUgKvkg5UAgNzzpSv8QBgkA==
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: <026f01da46fd$65fc1360$31f43a20$@gmail.com>
X-Mailman-Original-References: <5a6d88e-46b1-a3ea-333-d053cbe5654d@appl-ecosys.com>
<24aeb00e-41fd-4809-ae96-d429645cbc07@mrabarnett.plus.com>
<4a215b7d-f1af-49d7-1496-96e290255314@appl-ecosys.com>
<65A0E32A.2458.26DB92@RealGrizzlyAdams.vivaldi.net>
<CAJQBtgnNs6q_+MrPsir4Kioh8Zra+UepDiwx61c0NXcm3P3xOw@mail.gmail.com>
<76935eb3-ed67-428e-9aea-a8e527e12914@DancesWithMice.info>
<CAPTjJmqc6g9oBLMh9Mt6K5ozN+xUJJJ68TjHBHnMXAS62mydew@mail.gmail.com>
<CAJQBtg=+_46_NDqYcpbf+heO4RjStvpJOuui9wgKmiEDinS9jg@mail.gmail.com>
<CAPTjJmrvUxenuBptvTDKiXptnzvLZQRhhYR_nuRTGibE5LaB3Q@mail.gmail.com>
 by: - Sun, 14 Jan 2024 15:21 UTC

It can be worth considering why a language is designed or altered in certain
ways to see if there was a tradeoff that made it seem worthwhile or easier
than some other choice.

Python grew and there was regular pressure to add keywords which might break
existing programs. So, yes, sometimes, a keyword was re-used in a different
context. And, yes, it was not originally conceived in a purely object
oriented context.

If you wanted to start over and built a new language very similar to python,
you might indeed make other choices now that seem more seamlessly to fit
together. You could set aside and reserve hundreds of keywords or some way
to extend keywords by insisting anything staring with "key_" cannot be used
in a variable name. You might design all the main objects supported to all
support a function that provides a length as well as every other method
needed so it looks purely object oriented.

But perhaps that would make it a tad harder to program it using other ways.
As an example, I can ask some sort program to order the results by the
length of items by passing it the function that does lengths as an argument.
If instead all we had was a method, that might be a bit different and
perhaps someone would simply make a tiny function that when called, invoked
the method.

So, we have a hybrid of sorts and have to live with it, warts and all, and
some of the warts may be seen by some as beauty marks.

-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail.com@python.org> On
Behalf Of Chris Angelico via Python-list
Sent: Sunday, January 14, 2024 7:32 AM
To: python-list@python.org
Subject: Re: Extract lines from file, add to new files

On Sun, 14 Jan 2024 at 23:28, Left Right <olegsivokon@gmail.com> wrote:
> Having worked with a bunch of different grammar languages, the one
> used for Python isn't a recognizable BNF derivative.

That might possibly be because it isn't? It's not BNF. It's PEG. Or
are you a long way behind the times?

> For example, you may say "functions in Python are
> objects", but you cannot put a function definition in the head of the
> for loop clause.

What do you mean?

for x in lambda: ...:
...

Perfectly grammatical.

ChrisA
--
https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor