Design thought for callbacks

Ethan Furman ethan at stoneleaf.us
Sun Feb 22 16:02:00 EST 2015


On 02/22/2015 05:13 AM, Cem Karan wrote:

> Output:
> From Evil Zombie: Surprise!
> From Your Significant Other: Surprise!
> 
> 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 callback isn't
> really rising from the dead; as you say, either its been garbage collected, 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 library -- 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~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20150222/ae5e02ab/attachment.sig>


More information about the Python-list mailing list