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: How to exit program with custom code and custom message?

SubjectAuthor
o Re: How to exit program with custom code and custom message?Thomas Passin

1
Re: How to exit program with custom code and custom message?

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: lis...@tompassin.net (Thomas Passin)
Newsgroups: comp.lang.python
Subject: Re: How to exit program with custom code and custom message?
Date: Mon, 13 Mar 2023 23:29:06 -0400
Lines: 15
Message-ID: <mailman.2300.1678765091.20444.python-list@python.org>
References: <OS3P286MB0740BCCB71F9FBFA741642DFA5B99@OS3P286MB0740.JPNP286.PROD.OUTLOOK.COM>
<CAPTjJmp3W+ht_3SDZ2mPmZ3P7zULGXVo-kB_Qy=W6_GBDXe0gQ@mail.gmail.com>
<OS3P286MB07406D74CC77DD6FBBA569F0A5B99@OS3P286MB0740.JPNP286.PROD.OUTLOOK.COM>
<af7e9109-ca13-ce56-9e37-7e3abc5d9983@solute.de>
<OS3P286MB07400CDA833D208D59D3BF7CA5BE9@OS3P286MB0740.JPNP286.PROD.OUTLOOK.COM>
<bbe6df60-2465-5d40-bb3b-6d9d6c4ec44a@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de mSzalgL7hwSnxjfdLDzpFAA8H2i4BE0lPP1HbNghElRg==
Return-Path: <list1@tompassin.net>
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=tompassin.net header.i=@tompassin.net header.b=XCwUzGq4;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.022
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'fairly': 0.05;
'reasoning': 0.09; 'follows': 0.16; 'philosophy,': 0.16;
'received:10.0.0': 0.16; 'received:64.90': 0.16;
'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16;
'received:dreamhost.com': 0.16; 'subject:code': 0.16;
'subject:program': 0.16; 'wrote:': 0.16; 'python': 0.16; 'pm,':
0.19; 'to:addr:python-list': 0.20; 'subject:How': 0.23;
'function': 0.27; 'folks': 0.28; 'header:User-Agent:1': 0.30;
'think': 0.32; 'good.': 0.32; 'here,': 0.32; 'received:10.0':
0.32; 'received:mailchannels.net': 0.32;
'received:relay.mailchannels.net': 0.32; 'but': 0.32; 'there':
0.33; 'able': 0.34; 'header:In-Reply-To:1': 0.34; 'way': 0.38;
'handle': 0.39; 'subject:message': 0.40; 'definition': 0.64;
'your': 0.64; 'types': 0.67; 'accept': 0.67; 'header:Received:6':
0.67; 'received:64': 0.67; 'order': 0.69; 'tao': 0.84
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1678764547; a=rsa-sha256;
cv=none;
b=Jke2JTBAgq1mT8NePGMsZCdOKpDBqRh68k8hJNZaSKUkHfE1uy0P7FIdzLj2M2VGelmR33
zXNxJbhU8V1RIYDsza/GVbcipRXyXd85jey9ExCoFJmFUTHbdXyZj4d/FwEpqwRWbf+cAT
ldHPgoYyTiA8Uf6jRZGA4WT8D1w/OByr9Oip6Rfr5WEQJZ7XrSK4NOKOVcfa/Wfz7yYOTJ
aFUmAXzi/JZmX3IHC2J5CuGYheNnBzUZTM/rzr2Sr9syNf+p4ELW8wuSkcZa9HE/eR9SoS
E4sLH/Ui7JQmLWL3Sqgzjah/JfHW8sW2xwJo/EcdEw7sZvQs0CDGZXy5/TjwUQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
d=mailchannels.net; s=arc-2022; t=1678764547;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:dkim-signature;
bh=XAfTT6nh3evCXh80/p1Xx/ZiN+A6O3Eh+aNaikoEbSc=;
b=jsmuX/TwqII+jxBdw/P6mxoMLY+u2zK1nIymg/dTFeAp0qh94zR1zBuY5gmoOyk9ZQ1Hp8
iQgNXJU1ROgkSdXwFKPmYO5VqfaiRS/CKtZr9IqYN8pWo4/yUrhGlwSckt7SPECV+SqAQo
yvIN3z8zxzs9S4HzMRNIedL/RzJa7OtLtmxd5YypldGMVWqAMN3tPgI7UsC2UGrYbqYfEG
RIqoyZgxzS089tS0WtRggvlcOO6XIP890GSzQ8MZb3EnKzln8fmTSLOl4QJZZHyuu8Btjv
Jo7vpX5w8c0A8sAiLhPuE4L03EYJknTftK8A0D0+Vk7s1ahkwSOiImM9a1ZoBA==
ARC-Authentication-Results: i=1; rspamd-7584d5cf47-hl7pk;
auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Cooperative-Bottle: 6773f95b71b57f1d_1678764547373_1722491652
X-MC-Loop-Signature: 1678764547373:1162859185
X-MC-Ingress-Time: 1678764547372
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
s=dreamhost; t=1678764546;
bh=XAfTT6nh3evCXh80/p1Xx/ZiN+A6O3Eh+aNaikoEbSc=;
h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
b=XCwUzGq4FHMlU37zeGMHWL9mSnD2m8r5RoULd6ulakQ+96ScW9f4RvP2L7qG/V1IZ
+FqxFHXe3dqlKA4jBkCj4aBs4XQjmAORhVlrZUgP6XcZNW5UOoiF8YVFZeTi/tzrhT
1xtBD/+/b6V0lmRpU/pN/G1fPC+ERV7SHX6cVZ6QsvveiCBe0XVJzf/wxg5/DO+gTO
Qu0mIFQ9CG47j2EEpPqgGVSebsFhM0VyKb0F1Zfk3VQqsmYyq3yD/Xj9lL5DgUeSBo
6y/627RDtreg4jJ2iHVcanjUJ0lutFxiItPOtWNn2wx8jDpuGa94cQP/XTAcRiTNxR
VSjYVLcFgv0UA==
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Content-Language: en-US
In-Reply-To: <OS3P286MB07400CDA833D208D59D3BF7CA5BE9@OS3P286MB0740.JPNP286.PROD.OUTLOOK.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: <bbe6df60-2465-5d40-bb3b-6d9d6c4ec44a@tompassin.net>
X-Mailman-Original-References: <OS3P286MB0740BCCB71F9FBFA741642DFA5B99@OS3P286MB0740.JPNP286.PROD.OUTLOOK.COM>
<CAPTjJmp3W+ht_3SDZ2mPmZ3P7zULGXVo-kB_Qy=W6_GBDXe0gQ@mail.gmail.com>
<OS3P286MB07406D74CC77DD6FBBA569F0A5B99@OS3P286MB0740.JPNP286.PROD.OUTLOOK.COM>
<af7e9109-ca13-ce56-9e37-7e3abc5d9983@solute.de>
<OS3P286MB07400CDA833D208D59D3BF7CA5BE9@OS3P286MB0740.JPNP286.PROD.OUTLOOK.COM>
 by: Thomas Passin - Tue, 14 Mar 2023 03:29 UTC

On 3/13/2023 10:34 PM, scruel tao wrote:
> Lars:
>> I totally understand your reasoning here, but in some way it
>> follows the unix philosophy: Do only one thing, but do that good.

> I understand, python is not strongly typed, so `sys.exit` will be
> able to accept any types parameters rather than just integer. In
> order to handle such “other” types logic, I think this function
> already violated the unix philosophy, and there is no way to avoid
> it.

Most Python folks will say the Python *is* fairly strongly typed, but
for a different definition of "type". That is, duck typing.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor