Dirk Meyer wrote:
> Jason Tackaberry wrote:
>> On Fri, 2008-01-18 at 23:00 +0100, Dirk Meyer wrote:
>>> I added some doc for this. This task should be done in two steps.
>>> First make sure yield_execution always returns an InProgress object
>>> and second add the new Python 2.5 code. I did some changes and added
>>> some doc. I will stop here to discuss my notes in the file first and
>>> test all the other changes I made in kaa.notifier.
>>
>> Another thing we want to do is change the arguments passed to exception
>> signals (in InProgress, and other places) to receive three arguments:
>> exc_type, exc_instance, traceback.  It can be done with:
>>
>> try:
>>    somefunc()
>> except Exception, e:
>>    exception_handler(e.__class__, e, sys.exc_traceback)
>
> I'm not sure. I prefer the current way to add the traceback to the
> exception. In some parts of the code we give the exception to other
> parts of the code using 'raise'. In that case we will loose all the
> other information.

A second reason: you always get one parameter for your callback when
you connect to an InProgress object (the return value or the
exception). With your proposal it is harder to handle return and
exception in one function, IMHO it looks stupid to have two extra
parameter for an exception you don't need:

def is_is_a_callback_now(result):
    [...]

def this_would_be_a_callback(result, exception=None, traceback=None):
    if exception is not None:
        exception_type = result


Dischi

-- 
Last night I dreamed I ate a ten-pound marshmallow, and when I woke up
the pillow was gone.
                -- Tommy Cooper

Attachment: pgpEFQ8l9K7ZE.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to