Re: Using debug print routine inside assert
From: Peter Hansen (peter_at_engcorp.com)
Date: 11/04/03
- Next message: Christos : "Re: Please explain the meaning of 'stealing' a ref"
- Previous message: Peter Hansen: "Re: Testing & stdout"
- In reply to: Edvard Majakari: "Using debug print routine inside assert"
- Next in thread: Edvard Majakari: "Re: Using debug print routine inside assert"
- Reply: Edvard Majakari: "Re: Using debug print routine inside assert"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 04 Nov 2003 08:33:17 -0500
Edvard Majakari wrote:
>
[snip problem]
> What do you think, what is the best solution for this kind of problem? I
> for one wouldn't like to see myself writing assert(debug(...)) every now
> and then :)
My solution has been to dispense completely with "debugging code"
except *during* debugging (when a print or two might appear temporarily,
or a call to pdb.set_trace()), and instead do all my development using
unit tests.
With adequate use of the "unittest" standard module, I haven't encountered
any reason to call one of those old debug() routines or have a global
"debug level" variable for eons...
(I'm sorry that my advice is pretty much to change the way you do
development, but it has worked for me.)
-Peter
- Next message: Christos : "Re: Please explain the meaning of 'stealing' a ref"
- Previous message: Peter Hansen: "Re: Testing & stdout"
- In reply to: Edvard Majakari: "Using debug print routine inside assert"
- Next in thread: Edvard Majakari: "Re: Using debug print routine inside assert"
- Reply: Edvard Majakari: "Re: Using debug print routine inside assert"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]