Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!fdn.fr!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '*not*': 0.07; '21,': 0.07; 'callback': 0.09; 'logic': 0.09; 'cc:addr:python-list': 0.11; 'fail,': 0.16; 'garbage': 0.16; 'intervening': 0.16; 'registered.': 0.16; 'surprising': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'mechanism': 0.19; 'slightly': 0.19; 'feb': 0.22; 'appears': 0.22; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'to:2**1': 0.27; 'function': 0.29; "i'm": 0.30; 'about.': 0.31; "d'aprano": 0.31; 'releasing': 0.31; 'steven': 0.31; 'figure': 0.32; 'maybe': 0.34; 'problem': 0.35; 'received:google.com': 0.35; 'charset:us-ascii': 0.36; 'message-id:@gmail.com': 0.38; 'needed': 0.38; 'pm,': 0.38; 'track': 0.38; 'rather': 0.38; 'that,': 0.38; 'how': 0.40; 'event.': 0.60; 'then,': 0.60; 'hope': 0.61; 'making': 0.63; 'header:Message-Id:1': 0.63; 'more': 0.64; 'situation': 0.65; 'subject:Design': 0.78; 'subject:thought': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=v98KHaVu2+/Htnm0SmtJU+k6zVwW9QJYhQKG5/BBW7c=; b=sgvMs7r9IhgsKcKsgg4Vdw0lvnpDYelW+kMmSvI924R5BBQ3/IG7KZrchOXXjm/h94 uIRoJqXzrKkPZgrzHKxXcUK5YJG3nFipZnykdnvrjScO5uUOAQF9m5UJtuuRW3SPGm2c /h5bViG60U1OvKL0ZDJyWqi7U+KsznwirejKXd/T8AX1/94L21pZ3HmeGNCg987kKEj2 DqBZOMh21fcI4sYFVyt/NdYkO9Y0rP5d25IT9PtovfVBivt8GYHo3ghkAJcUa19mpdD+ rfTWsWR6SpI09ybVb82bj6byztR6o0K0F2Y5FK9WwLJzvKGirSe1PBo8ocV/kwJu3vDt f7PQ== X-Received: by 10.52.117.9 with SMTP id ka9mr6033845vdb.15.1424607376355; Sun, 22 Feb 2015 04:16:16 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Design thought for callbacks From: Cem Karan In-Reply-To: <87egpjtcp0.fsf@elektro.pacujo.net> Date: Sun, 22 Feb 2015 07:16:14 -0500 Content-Transfer-Encoding: quoted-printable References: <33677AE8-B2FA-49F9-9304-C8D93784255D@gmail.com> <54e8af1b$0$12976$c3e8da3$5496439d@news.astraweb.com> <87egpjtcp0.fsf@elektro.pacujo.net> To: Marko Rauhamaa , Steven D'Aprano X-Mailer: Apple Mail (2.1510) Cc: python-list@python.org 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424607379 news.xs4all.nl 2885 [2001:888:2000:d::a6]:59023 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86103 On Feb 21, 2015, at 12:08 PM, Marko Rauhamaa wrote: > Steven D'Aprano : >=20 >> Other than that, I cannot see how calling a function which has *not* >> yet been garbage collected can fail, just because the only reference >> still existing is a weak reference. >=20 > Maybe the logic of the receiving object isn't prepared for the = callback > anymore after an intervening event. >=20 > The problem then, of course, is in the logic and not in the callbacks. This was PRECISELY the situation I was thinking about. My hope was to = make the callback mechanism slightly less surprising by allowing the = user to track them, releasing them when they aren't needed without = having to figure out where the callbacks were registered. However, it = appears I'm making things more surprising rather than less. Thanks, Cem Karan=