2014-03-07 6:25 GMT+01:00 Nick Coghlan :
>> Uh, really? If you want to suppress all reference cycles, you *have* to
>> remove __traceback__.
>>
>> The problem is to make computation of the traceback summary lightweight
>> enough that it doesn't degrade performance in the common case where you
>> do
On 6 Mar 2014 23:44, "Antoine Pitrou" wrote:
>
> Le 05/03/2014 23:53, Nick Coghlan a écrit :
>>
>>
>> __traceback__ wouldn't change [...]
>
>
> Uh, really? If you want to suppress all reference cycles, you *have* to
remove __traceback__.
>
> The problem is to make computation of the traceback summ
Hi,
2014-03-06 16:19 GMT+01:00 Victor Stinner :
> By the way, here is my test script to try to create a lightweight
> traceback object without references to locals:
> https://bitbucket.org/haypo/misc/src/tip/python/suppress_locals.py
>
> It works if there is no chained exception.
I updated my pro
Antoine Pitrou wrote:
We might allow the creation of traceback objects, but without any custom
frame objects it is unclear how useful that would be.
When I was implementing Pyrex, I would have found it
very useful to be able to create Traceback objects
without Frames, but only if the Traceback
It's all very old C code that's deeply intertwined with interpreter
internals. Who knows what kind of assumptions are made by some of the C
code consuming frames and tracebacks...
On Thu, Mar 6, 2014 at 12:38 PM, Xavier Morel wrote:
> On 2014-03-06, at 19:32 , Guido van Rossum wrote:
> > But in
On 2014-03-06, at 19:32 , Guido van Rossum wrote:
> But inspect is in the stdlib. Surely changing inspect.py is less
> controversial than amending the semantics of frame objects.
I've no idea, I'm just giving a case where I could have used the ability
to create traceback objects even without the
But having exceptions without '__traceback__' affects not
only the inspect module, but also lots of other code. It
will make harder to write generic error reporting code, as
you'd need to check for __traceback__ first, and then, if
it's None, look for some other, asyncio specific attribute.
I th
But inspect is in the stdlib. Surely changing inspect.py is less
controversial than amending the semantics of frame objects.
On Thu, Mar 6, 2014 at 10:10 AM, Xavier Morel wrote:
> On 2014-03-06, at 16:52 , Antoine Pitrou wrote:
> > Le 06/03/2014 16:03, Yury Selivanov a écrit :
> >>
> >> On 2014
On 2014-03-06, at 16:52 , Antoine Pitrou wrote:
> Le 06/03/2014 16:03, Yury Selivanov a écrit :
>>
>> On 2014-03-06, 8:42 AM, Antoine Pitrou wrote:
>>> Le 05/03/2014 23:53, Nick Coghlan a écrit :
__traceback__ wouldn't change [...]
>>>
>>> Uh, really? If you want to suppress all refer
Le 06/03/2014 16:03, Yury Selivanov a écrit :
On 2014-03-06, 8:42 AM, Antoine Pitrou wrote:
Le 05/03/2014 23:53, Nick Coghlan a écrit :
__traceback__ wouldn't change [...]
Uh, really? If you want to suppress all reference cycles, you *have*
to remove __traceback__.
The problem is to make c
2014-03-06 14:42 GMT+01:00 Antoine Pitrou :
> Le 05/03/2014 23:53, Nick Coghlan a écrit :
>>
>>
>> __traceback__ wouldn't change [...]
>
>
> Uh, really? If you want to suppress all reference cycles, you *have* to
> remove __traceback__.
>
> The problem is to make computation of the traceback summar
On 2014-03-06, 8:42 AM, Antoine Pitrou wrote:
Le 05/03/2014 23:53, Nick Coghlan a écrit :
__traceback__ wouldn't change [...]
Uh, really? If you want to suppress all reference cycles, you *have*
to remove __traceback__.
The problem is to make computation of the traceback summary
lightwei
Le 05/03/2014 23:53, Nick Coghlan a écrit :
__traceback__ wouldn't change [...]
Uh, really? If you want to suppress all reference cycles, you *have* to
remove __traceback__.
The problem is to make computation of the traceback summary lightweight
enough that it doesn't degrade performance i
On 6 Mar 2014 08:32, "Yury Selivanov" wrote:
>
>
> On 2014-03-05, 4:54 PM, Nick Coghlan wrote:
>>
>> On 6 Mar 2014 02:43, "Antoine Pitrou" wrote:
>>>
>>> Le 05/03/2014 17:37, Victor Stinner a écrit :
>>>
Python 3.4 introduced frame.clear(), but frame.clear() raises an
RuntimeError if th
On 2014-03-05, 4:54 PM, Nick Coghlan wrote:
On 6 Mar 2014 02:43, "Antoine Pitrou" wrote:
Le 05/03/2014 17:37, Victor Stinner a écrit :
Python 3.4 introduced frame.clear(), but frame.clear() raises an
RuntimeError if the frame is still running. And it doesn't break all
reference cycles.
An o
On Wed, Mar 5, 2014 at 2:54 PM, Nick Coghlan wrote:
> Guido had a fix in mind - splitting traceback formatting into two pieces.
> The first would convert a traceback to a sequence of named tuples, the
> second would do the actual string formatting.
+1
This is basically how I've handled pickling
I think it was http://bugs.python.org/issue17911
On Wed, Mar 5, 2014 at 1:54 PM, Nick Coghlan wrote:
>
> On 6 Mar 2014 02:43, "Antoine Pitrou" wrote:
> >
> > Le 05/03/2014 17:37, Victor Stinner a écrit :
> >
> >>
> >> Python 3.4 introduced frame.clear(), but frame.clear() raises an
> >> Runtim
On 6 Mar 2014 02:43, "Antoine Pitrou" wrote:
>
> Le 05/03/2014 17:37, Victor Stinner a écrit :
>
>>
>> Python 3.4 introduced frame.clear(), but frame.clear() raises an
>> RuntimeError if the frame is still running. And it doesn't break all
>> reference cycles.
>>
>> An obvious workaround is to sto
On 2014-03-05, 11:37 AM, Victor Stinner wrote:
[snip]
I tried to write "views" of the traceback (and frames), but
Exception.__traceback__ rejects types other than traceback and
traceback instances cannot be created. It's possible to store the
traceback somewhere else and set Exception.__traceba
Le 05/03/2014 17:37, Victor Stinner a écrit :
Python 3.4 introduced frame.clear(), but frame.clear() raises an
RuntimeError if the frame is still running. And it doesn't break all
reference cycles.
An obvious workaround is to store the traceback as text, but this
operation is "expensive" especi
Hi,
Python 3 now stores the traceback object in Exception.__traceback__
and exceptions can be chained through Exception.__context__. It's
convinient but it introduced tricky reference cycles if the exception
object is used out of the except block.
Refrences: Exception.__traceback__ -> traceback -
21 matches
Mail list logo