Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #86295
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <random832@fastmail.us> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.019 |
| X-Spam-Evidence | '*H*': 0.96; '*S*': 0.00; 'tree': 0.05; 'callback': 0.09; 'chairs': 0.09; 'received:internal': 0.09; '24,': 0.16; 'help?': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'objects.': 0.16; 'owner.': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.212': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'feb': 0.22; 'refers': 0.24; "shouldn't": 0.24; 'tend': 0.24; 'suggested': 0.26; 'header:In-Reply-To:1': 0.27; 'code': 0.31; 'everywhere': 0.31; 'object.': 0.31; 'this.': 0.32; 'received:66': 0.35; 'but': 0.35; 'there': 0.35; 'object,': 0.36; 'method': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'structure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'chain': 0.60; 'removing': 0.60; 'from:no real name:2**0': 0.61; "you're": 0.61; 'header:Message-Id:1': 0.63; 'name': 0.63; 'subject:Design': 0.78; 'avoids': 0.84; 'dag': 0.84; 'listener': 0.84; 'subject:thought': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= message-id:x-sasl-enc:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=mesmtp; bh=Fi6Em2yjGcpq5u+ld1TNVCsWa4o=; b=rWo5 iXeGKDJZbi9s9eKybGMCIgimhA5xobLZwYc1O+JJzNAwE18DSR0YmK31LdIB+47y IliejUJ/BCbfGLRdHL42nM9NqL0qSObYcPrAEEUh+ctC8PIs+tcuuHujWQNWP6vL pCY8EC47QhsivwOYUsAcmhDOJtsCEvkFnmH07iY= |
| DKIM-Signature | v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to :mime-version:content-transfer-encoding:content-type:in-reply-to :references:subject:date; s=smtpout; bh=Fi6Em2yjGcpq5u+ld1TNVCsW a4o=; b=ETJAgIgjdXsuePuU0kCQLvT5T03ldzj8O70TePjUxRehnA4s/GLcIFv+ XQ52Iva9SjDMFUcJMzsiDF5ij9PwKPrB0HTJDqobJHxX0vc6p3CDZe8rpEqBqXyA 9n7sfBnfWuO/F+dyCDMLICj2ersJ3QjD9oUUwrgxcEg2uWs0jXg= |
| X-Sasl-Enc | 6aJ+/t6MiIsgNevd4OAIg7ctNBrut3KGDppFB7oBRKEJ 1424755791 |
| From | random832@fastmail.us |
| To | python-list@python.org |
| MIME-Version | 1.0 |
| Content-Transfer-Encoding | 7bit |
| Content-Type | text/plain |
| X-Mailer | MessagingEngine.com Webmail Interface - ajax-4ba7306c |
| In-Reply-To | <cl2g0vFfiq9U1@mid.individual.net> |
| References | <33677AE8-B2FA-49F9-9304-C8D93784255D@gmail.com> <CAPTjJmpEHQV2PpaZvszuTGn0_GNg0sWV6aLenbQsZrSXCy2YKQ@mail.gmail.com> <mailman.18957.1424524392.18130.python-list@python.org> <mcargl$h3k$1@reader1.panix.com> <mailman.19008.1424611304.18130.python-list@python.org> <cl2g0vFfiq9U1@mid.individual.net> |
| Subject | Re: Design thought for callbacks |
| Date | Tue, 24 Feb 2015 00:29:51 -0500 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| 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 | <http://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> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.19117.1424755795.18130.python-list@python.org> (permalink) |
| Lines | 16 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1424755795 news.xs4all.nl 2920 [2001:888:2000:d::a6]:33722 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:86295 |
Show key headers only | View raw
On Tue, Feb 24, 2015, at 00:20, Gregory Ewing wrote: > Cem Karan wrote: > > I tend to structure my code as a tree or DAG of objects. The owner refers to > > the owned object, but the owned object has no reference to its owner. With > > callbacks, you get cycles, where the owned owns the owner. > > This is why I suggested registering a listener object > plus a method name instead of a callback. It avoids that > reference cycle, because there is no long-lived callback > object keeping a reference to the listener. How does that help? Everywhere you would have had a reference to the "callback object", you now have a reference to the listener object. You're just shuffling deck chairs around: if B shouldn't reference A because A owns B, then removing C from the B->C->A reference chain does nothing to fix this.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Design thought for callbacks Cem Karan <cfkaran2@gmail.com> - 2015-02-21 08:13 -0500
Re: Design thought for callbacks Grant Edwards <invalid@invalid.invalid> - 2015-02-21 20:57 +0000
Re: Design thought for callbacks Marko Rauhamaa <marko@pacujo.net> - 2015-02-21 23:57 +0200
Re: Design thought for callbacks Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-22 13:04 +1100
Re: Design thought for callbacks Chris Angelico <rosuav@gmail.com> - 2015-02-22 13:11 +1100
Re: Design thought for callbacks Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-22 15:38 +1100
Re: Design thought for callbacks Chris Angelico <rosuav@gmail.com> - 2015-02-22 17:21 +1100
Re: Design thought for callbacks Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-22 21:32 +1100
Re: Design thought for callbacks Chris Angelico <rosuav@gmail.com> - 2015-02-22 22:14 +1100
Re: Design thought for callbacks Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-23 00:45 +1100
Re: Design thought for callbacks Chris Angelico <rosuav@gmail.com> - 2015-02-23 01:01 +1100
Re: Design thought for callbacks Marko Rauhamaa <marko@pacujo.net> - 2015-02-22 09:52 +0200
Re: Design thought for callbacks Chris Angelico <rosuav@gmail.com> - 2015-02-22 19:17 +1100
Re: Design thought for callbacks Marko Rauhamaa <marko@pacujo.net> - 2015-02-22 10:34 +0200
Re: Design thought for callbacks Chris Angelico <rosuav@gmail.com> - 2015-02-22 19:58 +1100
Re: Design thought for callbacks Marko Rauhamaa <marko@pacujo.net> - 2015-02-22 11:14 +0200
Re: Design thought for callbacks Chris Angelico <rosuav@gmail.com> - 2015-02-22 21:21 +1100
Re: Design thought for callbacks Laura Creighton <lac@openend.se> - 2015-02-22 12:28 +0100
Re: Design thought for callbacks Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-23 00:57 +1100
Re: Design thought for callbacks Marko Rauhamaa <marko@pacujo.net> - 2015-02-22 16:06 +0200
Re: Design thought for callbacks Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-22 00:05 -0700
Re: Design thought for callbacks Cem Karan <cfkaran2@gmail.com> - 2015-02-22 08:21 -0500
Re: Design thought for callbacks Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-02-24 18:20 +1300
Re: Design thought for callbacks random832@fastmail.us - 2015-02-24 00:29 -0500
Re: Design thought for callbacks Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-02-25 10:19 +1300
Re: Design thought for callbacks Cem Karan <cfkaran2@gmail.com> - 2015-02-25 07:50 -0500
Re: Design thought for callbacks Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-02-26 18:36 +1300
Re: Design thought for callbacks Cem Karan <cfkaran2@gmail.com> - 2015-02-26 05:58 -0500
Re: Design thought for callbacks Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-26 12:54 -0700
Re: Design thought for callbacks Ethan Furman <ethan@stoneleaf.us> - 2015-02-26 12:00 -0800
Re: Design thought for callbacks Cem Karan <cfkaran2@gmail.com> - 2015-03-02 06:06 -0500
Re: Design thought for callbacks Cem Karan <cfkaran2@gmail.com> - 2015-03-02 06:04 -0500
Re: Design thought for callbacks Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-02 08:34 -0700
Re: Design thought for callbacks Cem Karan <cfkaran2@gmail.com> - 2015-03-08 14:30 -0400
csiph-web