Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'say,': 0.05; 'correct.': 0.07; 'closed.': 0.09; 'handlers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'thread': 0.11; 'atexit': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'roy': 0.16; 'subject:questions': 0.16; 'thread?': 0.16; 'url:html)': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'tracker': 0.20; 'doc': 0.22; 'statement': 0.23; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'newer': 0.27; 'header:X -Complaints-To:1': 0.28; 'case,': 0.29; '"the': 0.29; 'probably': 0.29; 'this.': 0.29; 'url:python': 0.32; 'docs': 0.33; 'to:addr :python-list': 0.33; 'another': 0.33; 'changed': 0.34; 'wrong': 0.34; 'clear': 0.35; 'open': 0.35; 'pm,': 0.35; 'there': 0.35; 'received:org': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'should': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'registered': 0.38; 'some': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'header:Received:5': 0.40; 'first': 0.61; 'believe': 0.69; 'smith': 0.71; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Some questions about atexit Date: Wed, 12 Sep 2012 22:29:00 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347503376 news.xs4all.nl 6876 [2001:888:2000:d::a6]:50152 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29009 On 9/12/2012 8:58 PM, Roy Smith wrote: > The atexit docs (http://docs.python.org/library/atexit.html) are very > confusing. In one place they say, "The order in which the functions are > called is not defined". In another place, "all functions registered are > called in last in, first out order". Which is correct? Check the tracker (bugs.python.org) for atexit issues, open and closed. I believe there was one about order and whether to make a guarantee. The doc might have been changed one place and not another. The newer statement is probably correct. In any case, the wrong place should be corrected. > Also, it's not clear how atexit handlers interact with threading. Do > all handlers get called in the main thread? What if some other thread > registers a handler? Does it get called in that thread? Don't know about this. -- Terry Jan Reedy