[IPython-user] ipython prevents sys.last_traceback (etc.) from being set?

Zachary Pincus zpincus at stanford.edu
Fri Mar 10 11:00:55 CST 2006


So, from more reading of the python docs (though by no means  
exhaustive), it seems that sys.last_traceback it thread-safe if it is  
only set from interactive threads (of which there is at most one at a  
time). The standard exception handler does this, I presume.

So, is there any way in ipython to find out if the current thread is  
the interactive one? Or is the handler only installed for interactive  
threads?

Anyhow, something along that route is probably the way to ensure  
thread-safety for last_traceback.

Zach


On Mar 10, 2006, at 5:26 AM, Ville Vainio wrote:

> On 3/10/06, Zachary Pincus <zpincus at stanford.edu> wrote:
>
>> Correct me if I'm wrong, but there's nothing thread-unsafe about
>> *setting* these values, is there? It's just unsafe to use them? Or is
>> even setting them in a multithreaded context bad?
>
> It's the user of these variables that chooses to take the risk, yes. I
> think we should set them and let the programs choose whether to use
> them or not.
>
> --
> Ville Vainio - vivainio.googlepages.com
> vainio.blogspot.com - g[mail | talk]='vivainio'




More information about the IPython-user mailing list