Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed10.multikabel.net!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.84.MISMATCH!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; 'programmers,': 0.07; 'python': 0.08; 'all?': 0.09; ';-)': 0.12; 'c++': 0.12; '__del__': 0.16; 'destructor': 0.16; 'idioms': 0.16; 'really.': 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; 'warn': 0.16; 'cc:addr:python-list': 0.16; 'language': 0.16; '(i.e.': 0.17; 'wrote:': 0.18; 'thus': 0.21; 'cc:no real name:2**0': 0.21; 'received:209.85.210.174': 0.21; 'received:mail- iy0-f174.google.com': 0.21; 'header:In-Reply-To:1': 0.22; 'assume': 0.22; 'similarly': 0.23; 'cc:2**0': 0.26; '(even': 0.29; 'assuming': 0.29; 'mind.': 0.29; 'received:gov': 0.29; 'cc:addr:python.org': 0.29; '22,': 0.30; 'behaves': 0.30; 'subject:?': 0.31; 'shared': 0.31; 'certainly': 0.32; 'thu,': 0.32; "i've": 0.32; 'does': 0.32; 'familiar': 0.32; 'programmers': 0.32; 'header:User-Agent:1': 0.33; 'object': 0.33; 'steven': 0.34; 'light': 0.35; 'but': 0.37; 'charset:us-ascii': 0.37; 'received:google.com': 0.37; 'similar': 0.37; 'received:209.85': 0.38; 'think': 0.38; 'subject:from': 0.39; 'received:209': 0.39; 'fact,': 0.63; 'natural': 0.67; '-0500,': 0.84; 'subject:Best': 0.93 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=8zr+0NnyoWJtLU6XV+Pz80OyQXCPNzE2atDttiv4EMs=; b=dX+f5Yji4veyyVXNAGKjHun3NRlgu5R1ovlvWGhFYod5ioV2drfHwoYPzoymVEnMlx 3gcllBHLIPsi2bCF6RjSx9sga0JwvFCsCHiitikXPzNO4nJ86uuzZoD+ivqD9LRpwEoe HWmqfTgE1Y1G5hl956VO46bjSlg7Rh8UsGRpFN2tsBeGKrpbZ/p/4J24evd7zYJ8w1rL 5EohGAq7HtC1952ZjSMLHEBLJyXoIK8EXCCXhPI8SSZRydEofbgKZP59AuKcEMbtUyCY bTmAPpmCwHeOw/Nqd+Kle3pnTcsGh70EZZkLVJgEegx5AQ3vRI3txY4lVJdiYJ7uuE6H sNtw== Date: Thu, 22 Mar 2012 16:02:15 -0500 From: Tycho Andersen 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4f6b60b2$0$29981$c3e8da3$5496439d@news.astraweb.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQmGwClryPiJ7uepCYKOAUq9SSkEMIL1uBZ8rU5gF/Cj7ashozHFAqj2t9nNN1D1Pg37KWsK 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332450111 news.xs4all.nl 6893 [2001:888:2000:d::a6]:45277 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22052 On Thu, Mar 22, 2012 at 05:26:11PM +0000, Steven D'Aprano wrote: > On Thu, 22 Mar 2012 08:14:47 -0500, Tycho Andersen wrote: > > > I've had similar experiences. In fact, in light of all this - why does > > __del__ exist at all? Novice python users may (reasonably) assume it > > behaves similarly to a C++ destructor (even though the docs warn > > otherwise). > > What makes you think that novice Python users will be familiar with C++ > destructors? I don't, really. It's just natural to assume that __del__ is the "opposite" of __init__, when it's really not (i.e. every object is __init__ed, but not every object is destructed and thus __del__'d). Novice programmers may make this assumption (indeed, many experienced programmers do as well). > Be careful about assuming that idioms in > will be shared by all Python programmers, novice or expert. Yeah, C++ was the first language which has destructors that came to mind. It's certainly not my favorite ;-) \t