Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Stay the curse.


comp / comp.lang.python / Formatted Output and Argument Parsing (was: Re: Flubbed it in the second interation through the string: range error... HOW?)

SubjectAuthor
o Formatted Output and Argument Parsing (was: Re: Flubbed it in the2QdxY4RzWzUUiLuE

1
Subject: Formatted Output and Argument Parsing (was: Re: Flubbed it in the second interation through the string: range error... HOW?)
From: 2QdxY4RzWzUUiLuE@potatochowder.com
Newsgroups: comp.lang.python
Date: Wed, 29 May 2024 13:05 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: 2QdxY4RzWzUUiLuE@potatochowder.com
Newsgroups: comp.lang.python
Subject: Formatted Output and Argument Parsing (was: Re: Flubbed it in the
second interation through the string: range error... HOW?)
Date: Wed, 29 May 2024 09:05:16 -0400
Lines: 25
Message-ID: <mailman.60.1716987926.2909.python-list@python.org>
References: <28615cd5-5b77-44bb-ba3a-5ce6cad7c943@tompassin.net>
<ZlbCr8Bv1sV6fjzN@cskk.homeip.net>
<CAPTjJmrnw51BDHrY25hcSzH6-R+pwSSyHf6yOrDa=4iFQm4EPg@mail.gmail.com>
<ZlcoDPpQG4gDVANi@anomaly>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.uni-berlin.de oJ5WyQCEe0fKQtD4C3ukogz7N6EIr3Ppit0tBnYNm/OQ==
Cancel-Lock: sha1:Iu54/MNDC2yHu2gy1MEYpRC5Zng= sha256:Ew6LtmPcFrnIFoNEtTxtVMJiqY8VwqsvRBP9PgKiR8k=
Return-Path: <2QdxY4RzWzUUiLuE@potatochowder.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=potatochowder.com header.i=@potatochowder.com
header.b=KSGYljoO; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'looks': 0.02; '(for':
0.05; 'debugging': 0.07; 'angelico': 0.09; 'everywhere': 0.09;
'received:78': 0.09; '2024': 0.16; 'encoding': 0.16;
'everywhere,': 0.16; 'from:addr:2qdxy4rzwzuuilue': 0.16;
'from:addr:potatochowder.com': 0.16; 'hardly': 0.16;
'received:136.243': 0.16; 'received:172.58': 0.16;
'received:www458.your-server.de': 0.16; 'received:your-server.de':
0.16; 'subject:?)': 0.16; 'subject:second': 0.16;
'subject:string': 0.16; 'wrote:': 0.16; 'python': 0.16; "aren't":
0.19; 'to:addr:python-list': 0.20; 'received:de': 0.23; '(and':
0.25; 'brought': 0.26; 'chris': 0.28; 'output': 0.28; 'it,': 0.29;
'think': 0.32; 'python-list': 0.32; 'received:136': 0.32; 'said,':
0.32; "wouldn't": 0.32; 'but': 0.32; "i'm": 0.33; 'header:In-
Reply-To:1': 0.34; "it's": 0.37; 'block': 0.39; 'advantage': 0.40;
'likely': 0.61; 'skip:h 10': 0.61; 'years': 0.65; 'decided': 0.67;
'back': 0.67; 'more,': 0.67; '2003': 0.69; '2015,': 0.69;
'fixing': 0.69; 'subject:through': 0.69; 'debugging,': 0.84;
'subject: \n ': 0.84; 'glad': 0.86
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=potatochowder.com; s=default2305; h=In-Reply-To:Content-Type:MIME-Version:
References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc:
Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID;
bh=OiNjwuD3DgChNckZXDatyS4a6IWMLQE6NXE27lqxhXs=; b=KSGYljoOj8HM1iYd45sUajMY/a
GzQYQltv7S7rF6vquhGgcR4GndLxsurFH9K+ddskeQHksy88DrEJyhLuCdfvZrkL4LpdaEeCMbuAJ
42c8ttswrwbhWXeJ6646cH3C8XqKudf4AsadrzDma3D+lX1ly1htYxKWFfSc+AHxAGKjRBZn4x+by
Yv3qtHWM9nBCEeKhQjhoNhYsa1pEvxD+qrbaljFg/ZBNBEJWM8rfA1C/m3HhPSlG67Y9XpaU99Y5h
WUVpECuhLTrxxlBo47HDFQI6SLjz65nH5s2KthTm7D0FRAuFG2/PvaNuQQYLgTAvdtf90dgSMCZxq
SttPLK7g==;
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <CAPTjJmrnw51BDHrY25hcSzH6-R+pwSSyHf6yOrDa=4iFQm4EPg@mail.gmail.com>
X-Authenticated-Sender: 2QdxY4RzWzUUiLuE@potatochowder.com
X-Virus-Scanned: Clear (ClamAV 0.103.10/27290/Wed May 29 10:30:54 2024)
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: <ZlcoDPpQG4gDVANi@anomaly>
X-Mailman-Original-References: <28615cd5-5b77-44bb-ba3a-5ce6cad7c943@tompassin.net>
<ZlbCr8Bv1sV6fjzN@cskk.homeip.net>
<CAPTjJmrnw51BDHrY25hcSzH6-R+pwSSyHf6yOrDa=4iFQm4EPg@mail.gmail.com>
View all headers

On 2024-05-29 at 17:14:51 +1000,
Chris Angelico via Python-list <python-list@python.org> wrote:

> I wouldn't replace str.format() everywhere, nor would I replace
> percent encoding everywhere - but in this case, I think Thomas is
> correct. Not because it's 2024 (f-strings were brought in back in
> 2015, so they're hardly chronologically special), but because most of
> this looks like debugging output that can take advantage of this
> feature:
>
> print(f"if block {name[index]=} {index=}")

defsnark:

After years of getopt (and even more, if you include non-Python
experience), I'm glad I decided to wait a decade before chugging the
optparse koolaid.

(For the history-impaired, getopt existed long before Python and will
likely exist long after it, but getopt's "replacement" optparse lasted
only from 2003 until 2011.)

That said, I agree that the = thing makes f-strings eminently useful for
debugging, and I wholeheartedly agree with not fixing things that aren't
broken.

1

rocksolid light 0.9.8
clearnet tor