any macro-like construct/technique/trick?

Georges JEGO gjego at free.fr
Sat Jun 4 13:10:03 CEST 2005


Mac a écrit :
>     # .... do some stuff
>     if debug:
>         emit_dbg_obj(DbgObjFoo(a,b,c))

Assuming your debug functions always return true, you could use:

     assert emit_dbg_obj(DbgObjFoo(a,b,c))

and have this code executed -or not- depending on the use of "-O"

-- Georges



More information about the Python-list mailing list