Hi,

Here is patch for Handle:
http://codereview.appspot.com/105570044

- Handle.cancel() clears _callback and _args
- In debug mode, add "created at" to repr(Handle)

Victor

2014-07-04 23:45 GMT+02:00 Guido van Rossum <[email protected]>:
> Cool, I think we have a plan then.
>
>
> On Fri, Jul 4, 2014 at 1:42 PM, Victor Stinner <[email protected]>
> wrote:
>>
>> 2014-07-04 16:52 GMT+02:00 Guido van Rossum <[email protected]>:
>> > But wouldn't keeping the traceback (on cancel) be just as detrimental as
>> > keeping the callback/args?
>>
>> _source_traceback is not a Python traceback object, it's the result of
>> traceback.extract_stack(). I chose this function because it avoids
>> introducing reference cycle. It would be annoying to add reference
>> cycles in debug mode, while the debug mode is usually used to debug
>> tricky issues like reference cycles :-)
>>
>> Storing the traceback as a list has a nice side effect: it's possible
>> to hide "internal" calls to only show the traceback of the user code.
>> For example, async() truncates the traceback to hide the call to
>> Task() constructor. So you only see the call to async().
>>
>> Storing extract_stack() is maybe more expensive than storing a
>> traceback object, but I don't care of performances in debug mode. I
>> designed the debug mode to be able to call more expensive code (in
>> debug mode) :-)
>>
>> Victor
>
>
>
>
> --
> --Guido van Rossum (python.org/~guido)

Reply via email to