Showing content from http://mail.python.org/pipermail/python-dev/attachments/20140306/453aeec0/attachment.html below:
<p dir="ltr"><br>
On 6 Mar 2014 08:32, "Yury Selivanov" <<a href="mailto:yselivanov.ml@gmail.com">yselivanov.ml@gmail.com</a>> wrote:<br>
><br>
><br>
> On 2014-03-05, 4:54 PM, Nick Coghlan wrote:<br>
>><br>
>> On 6 Mar 2014 02:43, "Antoine Pitrou" <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br>
>>><br>
>>> Le 05/03/2014 17:37, Victor Stinner a écrit :<br>
>>><br>
>>>> Python 3.4 introduced frame.clear(), but frame.clear() raises an<br>
>>>> RuntimeError if the frame is still running. And it doesn't break all<br>
>>>> reference cycles.<br>
>>>><br>
>>>> An obvious workaround is to store the traceback as text, but this<br>
>>>> operation is "expensive" especially if the traceback is only needed in<br>
>>>> rare cases.<br>
>>><br>
>>><br>
>>> Another "obvious" workaround is to call frame.clear() from the parent<br>
>><br>
>> function (i.e. have a dedicated wrapping layer).<br>
>><br>
>> Guido had a fix in mind - splitting traceback formatting into two pieces.<br>
>> The first would convert a traceback to a sequence of named tuples, the<br>
>> second would do the actual string formatting.<br>
><br>
><br>
> I don't like the idea of using tuples instead of tracebacks<br>
> in 'exception.__traceback__'. Lots of introspection and logging<br>
> tools except to find tracebacks in exceptions, and do custom<br>
> formatting or submitting data to remote servers for further<br>
> analysis (sometimes with values of local variables in frames).<br>
> If asyncio starts stripping exception.__traceback__ and using<br>
> namedtuples, it will make it harder to write/integrate such<br>
> tools.</p>
<p dir="ltr">__traceback__ wouldn't change - this is a variant on Victor's point that it is currently easy to store the already formatted traceback as a string, but that wastes time formatting a string you may never display, and is hard to manipulate programmatically. </p>
<p dir="ltr">Extracting a traceback summary from __traceback__ instead can address both limitations.</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> Yury<br>
><br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4