On Tue, Jan 04, 2011 at 12:56:16AM +0200, Michael Goldish wrote:
On 01/04/2011 12:06 AM, Eduardo Habkost wrote:
On Mon, Jan 03, 2011 at 07:22:17PM -0200, Eduardo Habkost wrote:
[...]
If you want to be extra careful, you can keep an index of contexts for
each exception ever seen, and clear
On Tue, Jan 04, 2011 at 12:56:16AM +0200, Michael Goldish wrote:
I think that's risky:
try:
vm.create() # context aware, raises an exception
except:
try:
vm.destroy() # context aware, raises an exception
except:
pass
raise
Heh, did you try the code
On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote:
+# Exception context information:
+# --
+# Every function can have some context string associated with it.
+# The context string can be changed by calling context(str) and cleared by
+# calling
On Mon, Jan 03, 2011 at 05:26:20PM -0200, Eduardo Habkost wrote:
On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote:
+# Exception context information:
+# --
+# Every function can have some context string associated with it.
+# The context string
On 01/03/2011 09:26 PM, Eduardo Habkost wrote:
On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote:
+# Exception context information:
+# --
+# Every function can have some context string associated with it.
+# The context string can be changed by
On Mon, Jan 03, 2011 at 09:48:02PM +0200, Michael Goldish wrote:
On 01/03/2011 09:26 PM, Eduardo Habkost wrote:
On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote:
+# Exception context information:
+# --
+# Every function can have some context
On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote:
+
+context_data = threading.local()
+context_data.contexts = {}
Won't this create a single dictionary, only for one single thread,
leaving all other threads with 'context_data.contexts' undefined?
--
Eduardo
--
To unsubscribe
On 01/03/2011 10:26 PM, Eduardo Habkost wrote:
On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote:
+
+context_data = threading.local()
+context_data.contexts = {}
Won't this create a single dictionary, only for one single thread,
leaving all other threads with
On 01/03/2011 10:16 PM, Eduardo Habkost wrote:
On Mon, Jan 03, 2011 at 09:48:02PM +0200, Michael Goldish wrote:
On 01/03/2011 09:26 PM, Eduardo Habkost wrote:
On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote:
+# Exception context information:
+# --
On Mon, Jan 03, 2011 at 11:07:53PM +0200, Michael Goldish wrote:
If I understand your suggestion correctly, then:
- The purpose of contexts is to add information to exceptions. If an
exception is raised and you call clear_context() in a finally clause,
you remove the context of the
On 01/04/2011 12:06 AM, Eduardo Habkost wrote:
On Mon, Jan 03, 2011 at 07:22:17PM -0200, Eduardo Habkost wrote:
On Mon, Jan 03, 2011 at 11:07:53PM +0200, Michael Goldish wrote:
If I understand your suggestion correctly, then:
- The purpose of contexts is to add information to exceptions. If
11 matches
Mail list logo