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

2015-08-13 Thread Michael Torrie
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 sor

[OT] unwritten list etiquette ate, was Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-13 Thread Michael Torrie
On 08/13/2015 12:26 AM, Sven R. Kunze wrote: > > Btw. to me, the *context is the entire post*, not just two lines. You're a very rare person indeed. Most people seem to not read any of the post except the first and last lines. At least posting inline shows me they've read and understood the porti

Re: [Meta] How to post properly (was: Re: Hooking Mechanism when Entering and Leaving a Try Block)

2015-08-13 Thread Steven D'Aprano
On Thu, 13 Aug 2015 07:09 pm, Marko Rauhamaa wrote: > A third rule, which I'm violating here myself, is stick to > Python-related topics on this newsgroup. On the sorts of places that take these sorts of fine distinctions seriously, your post would be considered Meta rather than Off-topic. That i

[OT] How to post properly (was: Re: Hooking Mechanism when Entering and Leaving a Try Block)

2015-08-13 Thread Marko Rauhamaa
Mark Lawrence : > The rule has been no top posting here for the 15 years I've been using > Python. Top posting is simply annoying. However, I'd like people to also stick to another rule: only quote a few lines. I should start seeing your contribution to the discussion without scrolling because t

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-13 Thread Mark Lawrence
On 13/08/2015 07:26, Sven R. Kunze wrote: On 13.08.2015 02:45, Chris Angelico wrote: On Thu, Aug 13, 2015 at 6:54 AM, Mark Lawrence wrote: On 12/08/2015 19:44, Sven R. Kunze wrote: On 12.08.2015 18:11, Chris Angelico wrote: (Please don't top-post.) Is this some guideline? I actually quite

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-13 Thread Jonas Wielicki
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 13.08.2015 08:26, Sven R. Kunze wrote: > > So, I take this as a "my personal preference guideline" because I > cannot find an official document for this (maybe, I am looking at > the wrong places). - From RFC 1855 (Netiquette Guidelines

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-12 Thread Sven R. Kunze
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

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-12 Thread Sven R. Kunze
On 13.08.2015 02:45, Chris Angelico wrote: On Thu, Aug 13, 2015 at 6:54 AM, Mark Lawrence wrote: On 12/08/2015 19:44, Sven R. Kunze wrote: On 12.08.2015 18:11, Chris Angelico wrote: (Please don't top-post.) Is this some guideline? I actually quite dislike pick somebody's mail to pieces. It

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-12 Thread Chris Angelico
On Thu, Aug 13, 2015 at 6:54 AM, Mark Lawrence wrote: > On 12/08/2015 19:44, Sven R. Kunze wrote: >> >> On 12.08.2015 18:11, Chris Angelico wrote: >>> >>> (Please don't top-post.) >> >> >> Is this some guideline? I actually quite dislike pick somebody's mail to >> pieces. It actually pulls things

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-12 Thread Mark Lawrence
On 12/08/2015 19:44, Sven R. Kunze wrote: On 12.08.2015 18:11, Chris Angelico wrote: (Please don't top-post.) Is this some guideline? I actually quite dislike pick somebody's mail to pieces. It actually pulls things out of context. But if this is a rule for this, so be it. The rules here ar

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-12 Thread Sven R. Kunze
On 12.08.2015 18:11, Chris Angelico wrote: On Thu, Aug 13, 2015 at 2:05 AM, Sven R. Kunze wrote: Unfortunately, no. :( It should work out of the box with no "let me replace all my try-except statements in my 10 million line code base". (Please don't top-post.) Is this some guideline? I actu

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-12 Thread Chris Angelico
On Thu, Aug 13, 2015 at 2:05 AM, Sven R. Kunze wrote: > Unfortunately, no. :( > > It should work out of the box with no "let me replace all my try-except > statements in my 10 million line code base". (Please don't top-post.) Sounds to me like you want some sort of AST transform, possibly in an

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-12 Thread Sven R. Kunze
Unfortunately, no. :( It should work out of the box with no "let me replace all my try-except statements in my 10 million line code base". On 12.08.2015 17:32, Ian Kelly wrote: On Tue, Aug 11, 2015 at 3:47 PM, Sven R. Kunze wrote: is there something like a hook that a Python module could re

Re: Hooking Mechanism when Entering and Leaving a Try Block

2015-08-12 Thread Ian Kelly
On Tue, Aug 11, 2015 at 3:47 PM, Sven R. Kunze wrote: > is there something like a hook that a Python module could register to in > order to 'trace' the entering and leaving of arbitrary try blocks? Not that I'm aware of. However, it sounds like context managers might do what you want. You would