Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The clothes have no emperor. -- C. A. R. Hoare, commenting on ADA.


devel / comp.lang.python / exit() builtin, was Re: imaplib: is this really so unwieldy?

SubjectAuthor
o exit() builtin, was Re: imaplib: is this really so unwieldy?Peter Otten

1
exit() builtin, was Re: imaplib: is this really so unwieldy?

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: __pete...@web.de (Peter Otten)
Newsgroups: comp.lang.python
Subject: exit() builtin, was Re: imaplib: is this really so unwieldy?
Date: Wed, 26 May 2021 16:40:18 +0200
Lines: 34
Message-ID: <mailman.362.1622040032.3087.python-list@python.org>
References: <14hqag1k3ujs43uij6rig68vckqo97j386@4ax.com>
<YK2B+N7GUDWauP47@cskk.homeip.net> <s8lmkh$q2m$1@ciao.gmane.io>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de nsmhgGvGzcY7uyo57FK7ZA6w88TflxFWr7ip5wdJug/w==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'traceback': 0.04; '(most':
0.05; 'last):': 0.05; ':-)': 0.09; 'available:': 0.09; 'message-
id:@ciao.gmane.io': 0.09; 'ok,': 0.09; 'received:ciao.gmane.io':
0.09; 'received:gmane.io': 0.09; 'received:list': 0.09; 'import':
0.14; '+0200,': 0.16; '3.8.2': 0.16; '>>>>>': 0.16; 'bye': 0.16;
'cameron': 0.16; 'from:addr:web.de': 0.16; 'ideal.': 0.16;
'received:116.202': 0.16; 'received:116.202.254': 0.16;
'received:116.202.254.214': 0.16; 'simpson': 0.16; 'subject:() ':
0.16; 'wrote:': 0.16; 'python': 0.16; 'tue,': 0.18; "i've": 0.22;
'to:addr:python-list': 0.23; 'idea': 0.25; '>>>': 0.26; 'library':
0.27; "didn't": 0.29; 'header:User-Agent:1': 0.31; 'it,': 0.31;
'"",': 0.32; 'fine.': 0.32; 'program': 0.33; 'header:In-Reply-
To:1': 0.33; 'way': 0.37; 'file': 0.38; 'use': 0.38; 'means':
0.40; 'subject:this': 0.63; 'named': 0.63; 'right': 0.66;
'received:116': 0.71; '2021': 0.84; 'practical': 0.84;
'subject:builtin': 0.84; 'subject:really': 0.84
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101
Thunderbird/78.10.2
In-Reply-To: <YK2B+N7GUDWauP47@cskk.homeip.net>
Content-Language: en-US
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
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: <s8lmkh$q2m$1@ciao.gmane.io>
X-Mailman-Original-References: <14hqag1k3ujs43uij6rig68vckqo97j386@4ax.com>
<YK2B+N7GUDWauP47@cskk.homeip.net>
 by: Peter Otten - Wed, 26 May 2021 14:40 UTC

On 26/05/2021 01:02, Cameron Simpson wrote:
> On 25May2021 15:53, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
>> On Tue, 25 May 2021 19:21:39 +0200, hw <hw@adminart.net> declaimed the
>> following:
>>> Oh ok, it seemed to be fine. Would it be the right way to do it with
>>> sys.exit()? Having to import another library just to end a program
>>> might not be ideal.
>>
>> I've never had to use sys. for exit...
>>
>> C:\Users\Wulfraed>python
>> Python ActivePython 3.8.2 (ActiveState Software Inc.) based on
>> on win32
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> exit()
>
> !!!!!!!!
>
> I have learned a new thing today.
>
> Regardless, hw didn't call it, just named it :-)

exit() is inserted into the built-ins by site.py. This means it may not
be available:

PS D:\> py -c "exit('bye ')"
bye
PS D:\> py -S -c "exit('bye ')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'exit' is not defined

I have no idea if this is of any practical relevance...

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor