Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.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; 'python,': 0.02; 'say,': 0.05; 'bug.': 0.09; 'callback': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; '~ethan~': 0.09; 'bug': 0.12; '(just': 0.16; 'filename:fname piece:signature': 0.16; 'garbage': 0.16; 'other:': 0.16; 'unexpected': 0.16; 'prevent': 0.16; 'wrote:': 0.18; 'library': 0.18; "hasn't": 0.19; 'code,': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'earlier': 0.24; '(or': 0.24; 'least': 0.26; 'somewhere': 0.26; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'forgot': 0.30; 'evil': 0.31; "they'll": 0.31; 'bugs': 0.33; 'moment': 0.34; 'problem': 0.35; "can't": 0.35; 'case,': 0.35; 'but': 0.35; 'really': 0.36; 'library.': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'called': 0.40; 'received:173': 0.61; "you're": 0.61; 'behavior': 0.77; 'subject:Design': 0.78; 'bitten': 0.84; 'rising': 0.84; 'subject:thought': 0.84 Date: Sun, 22 Feb 2015 13:02:00 -0800 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Design thought for callbacks References: <33677AE8-B2FA-49F9-9304-C8D93784255D@gmail.com> <39813568-6DB8-4341-A130-C256CFF352EE@gmail.com> <54e8c017$0$13008$c3e8da3$5496439d@news.astraweb.com> <51947083-01AC-4D1E-ACBD-3C476446B527@gmail.com> In-Reply-To: <51947083-01AC-4D1E-ACBD-3C476446B527@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q0rExt4G2LINSOlIttOr5mbvnDod2Xdxb" 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: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424638965 news.xs4all.nl 2923 [2001:888:2000:d::a6]:39797 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86154 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --q0rExt4G2LINSOlIttOr5mbvnDod2Xdxb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 02/22/2015 05:13 AM, Cem Karan wrote: > Output: > From Evil Zombie: Surprise! > From Your Significant Other: Surprise! >=20 > In this case, the user made an error (just as Marko said in his earlier= message), > and forgot about the callback he registered with the library. The call= back isn't > really rising from the dead; as you say, either its been garbage collec= ted, or it > hasn't been. However, you may not be ready for a callback to be called= at that > moment in time, which means you're surprised by unexpected behavior. But the unexpected behavior is not a problem with Python, nor with your l= ibrary -- it's a bug in the fellow-programmer's code, and you can't (or at least shouldn't) try to prevent those kinds of= bugs from manifesting -- they'll just get bitten somewhere else by the same bug. -- ~Ethan~ --q0rExt4G2LINSOlIttOr5mbvnDod2Xdxb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJU6kPMAAoJENZ7D1rrH75Nc1QQAJ8kCu8FAfrTyCRBxRK0iihx e1t60qy3ZEeDdZTHxzh5ah7jZhRY95OaT7d/Fhq944i3o6MCbUqT9DVAC8GLtvA0 wKJLNMXovTR6VpYg5BC1QcALpjqnulS2TnL7Gm0NUkZutb7esBloEDBcTKChkf2j baceFN1DNGVXiiLJA+EtcjzLpdMvPvyrzFQs0dFRUshQyqxpquxk4Muo275K6yXJ voPKKeAjhxV8HNtJTG4dXHPNYJGl4+QcJLAOG0riIWjPA+dKmyqFoTOAwaFQgR5t XvvF9S/nxKwylGKARn2ijdYeNE6/9+qmeP4t+iPLQTVrICkH7x1SjpaFZjZTkZJa zVwRzVAVs/6HUvcacVsk5iOw2aHHlsRoyx3SNmgJAg5zH0iyCIPLYLuy9gep1mxj VptOk8FctWmLTF8/BJv7omLJ/Sbwtz0YazDj8bfGlDIHW6tZ7CLVWZLFRKScxe87 7gyO4WcPDnRPkaWFsq3nIUWK6/L3t7EV0v3dhbgY81+Tl7N6qkmoHB7yHl8PYphP QpzDHTck0J2aslykHdKW1b9f5a2uQHqwgXnYMp3F66IHFFW1NVXCoyW9hkipAaM0 KzIq8dcTpCkX7n5mnBwVnvaJ49kmgF36texElDlTHnoFAemRywMoq7IMtcFpEFwl XTce8rUrybi37RgJbSKo =RX0U -----END PGP SIGNATURE----- --q0rExt4G2LINSOlIttOr5mbvnDod2Xdxb--