On Donnerstag 25 Oktober 2007, Dirk Meyer wrote:
> | class AtTimer(Callback)
> |     def schedule(hour=range(24), min=range(60), sec=0):
> |         ...
> |     def stop()
> |         ...
>
> Callback return False and it will be removed, just like Timer.

I only read about Timer, and did not try it out - what happens if the callback 
returns None?  In another project, I introduced a callback API where "True" 
is the returned value for 99% of the callbacks, but I adhered to Python's 
duck typing principle, which turned out to be a bad idea:  If you just leave 
out the return, the wrong thing happens, since None is considered to be a 
false value.  This annoyed me so often that I just needed to write this post 
to keep anyone from making the same mistake.

-- 
Ciao, /  /                                                    .o.
     /--/                                                     ..o
    /  / ANS                                                  ooo

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to