Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'context': 0.04; 'sanity': 0.07; 'python': 0.08; 'namespace': 0.09; ';-)': 0.12; '-tkc': 0.16; '__del__': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'message-id:@tim.thechases.com': 0.16; 'received:50': 0.16; 'received:70.251': 0.16; 'received:dsl.rcsntx.swbell.net': 0.16; 'received:rcsntx.swbell.net': 0.16; 'received:swbell.net': 0.16; 'subject:ldap': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'versions': 0.23; 'cc:2**0': 0.26; 'cc:addr:python.org': 0.29; 'definition': 0.30; 'subject:?': 0.31; 'thu,': 0.32; "i've": 0.32; 'there': 0.33; "can't": 0.33; 'header:User-Agent:1': 0.33; 'it?': 0.33; 'steven': 0.34; 'frustrated': 0.34; 'things': 0.35; '(for': 0.35; 'some': 0.38; 'useful': 0.38; "i'd": 0.39; 'subject:from': 0.39; 'more': 0.61; 'managers': 0.62; 'sick': 0.73; 'saving': 0.78; '-0500,': 0.84; 'readily': 0.93; 'subject:Best': 0.93 Date: Thu, 22 Mar 2012 12:54:29 -0500 From: Tim Chase User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111120 Icedove/3.1.16 MIME-Version: 1.0 To: Steven D'Aprano Subject: Re: Best way to disconnect from ldap? References: <4F6A4D02.6020403@tim.thechases.com> <4f6b60b2$0$29981$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <4f6b60b2$0$29981$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Source: X-Source-Args: X-Source-Dir: Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332438846 news.xs4all.nl 6863 [2001:888:2000:d::a6]:58037 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22035 On 03/22/12 12:26, Steven D'Aprano wrote: > On Thu, 22 Mar 2012 08:14:47 -0500, Tycho Andersen wrote: >> Given that you can't trust __del__, is there a legitimate >> use case for it? > > I've never found the need to write one. I've found the need to write them...then been frustrated by things falling out of namespace reach, and found that context managers do a much more reliable/understandable job, saving what little sanity I had left. ;-) So I'd say that __del__ was really only useful (for some sick, sick definition of "useful") in versions of Python before context-managers were readily available. -tkc