Decorater inside a function? Is there a way?

Jeremy Bowers jerf at jerf.org
Fri Apr 1 13:47:06 EST 2005


On Fri, 01 Apr 2005 18:30:56 +0000, Ron_Adam wrote:
> I'm trying to figure out how to test function arguments by adding a
> decorator.

The rest of your message then goes on to vividly demonstrate why
decorators make for a poor test technique.

Is this an April Fools gag? If so, it's not a very good one as it's quite
in line with the sort of question I've seen many times before. "I have
a hammer, how do I use it to inflate my tire?"

Assuming you're serious, why not use one of the many testing technologies
actually designed for it, and tap into the associated body of knowledge on
how to accomplish various tasks? Start with what you're trying to do, then
work on how to do it. 



More information about the Python-list mailing list