Howto MACRO in python ?
lorenb2 at bezeqint.net
Tue Aug 12 14:28:31 CEST 2003
Welp, I'm trying to implement some kind of tracing mechanism which will
announce every function entrance
I wrote a trace function:
DEBUG_LVL = 50
def trace(level, message):
if DEBUG_LVL >= level:
to which I will call with:
trace(40, "%s.%s: entrance" % (__name__, <function_name>) )
upon every function entrance.
(btw I couldn't find any built-in name which correspands to the current
function name so
I type it myslef every trace call)
my wish was to create a MACRO that will save me some text in the code.
that will expand into the trace call.
what do you think ?
thanks so much !
----- Original Message -----
From: "Peter Hansen" <peter at engcorp.com>
To: <python-list at python.org>
Sent: Tuesday, August 12, 2003 1:32 PM
Subject: Re: Howto MACRO in python ?
> Bill Loren wrote:
> > I was looking for a guidance about how to code MACROs in python.
> > any offer ?
> A few alternative responses to Irmen's to-the-point answer:
> 1. Nobody does.
> 2. Those who do, probably use a macro language, like maybe M4.
> 3. Nobody does.
> 4. What are you actually trying to accomplish, specifically?
More information about the Python-list