Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95360 > unrolled thread

[Back off topic] - Re: Hooking Mechanism when Entering and Leaving a Try Block

Started byMichael Torrie <torriem@gmail.com>
First post2015-08-13 18:57 -0600
Last post2015-08-13 18:57 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [Back off topic] - Re: Hooking Mechanism when Entering and Leaving a Try Block Michael Torrie <torriem@gmail.com> - 2015-08-13 18:57 -0600

#95360 — [Back off topic] - Re: Hooking Mechanism when Entering and Leaving a Try Block

FromMichael Torrie <torriem@gmail.com>
Date2015-08-13 18:57 -0600
Subject[Back off topic] - Re: Hooking Mechanism when Entering and Leaving a Try Block
Message-ID<mailman.180.1439513882.3627.python-list@python.org>
On 08/13/2015 12:28 AM, Sven R. Kunze wrote:
> On 12.08.2015 20:44, Sven R. Kunze wrote:
>> On 12.08.2015 18:11, Chris Angelico wrote:
>>> Sounds to me like you want some sort of AST transform, possibly in an
>>> import hook. Check out something like MacroPy for an idea of how
>>> powerful this sort of thing can be.
>>
>> Sounds like I MacroPy would enable me to basically insert a function 
>> call before and after each try: block at import time. Is that correct 
>> so far? That sounds not so bad at all.
>>
>>
>> However, if that only works due to importing it is not a solution. I 
>> need to make sure I catch all try: blocks, the current stack is in 
>> (and is about to step into).
>>
>> Ah yes, and it should work with Python 3 as well. 
> 
> Back to topic, please. :)

But we love being off topic!

Also if you change the subject line to demarcate a branch in the
discussion (and mark it as off topic), that is completely acceptable as
well.  This in fact was done eventually by Marko.  That leaves the
original part of the thread to carry on its merry way.  Of course I am
assuming you read your email using a threaded email client that shows
you the nested tree structure of the replies, instead of the really
strange 1-dimensional gmail-style conversations that lose that structure
entirely.

But I digress.  We get sidetracked rather easily around here.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web