Please translate this easy snip of C++ to Python

Phlip phlip_cpp at
Sun Feb 4 20:59:52 CET 2001


Ogle this awesome snip of C++:

        #define TRACE_(x) cout << #x ": " << x << endl

When you use that like this:

        TRACE_(y + z);

the program emits this:

        y + z: 12
        strAnimals: Lemmings
        __LINE__:  69

Mighty healthy and easy to write debug statements with, huh? Saves a lot of 
keystrokes, huh?

How do I do that, just as easy to call, in Python?

  Phlip                          phlip_cpp at
============ ============
  --  In the beginning, God distinguished heaven and earth  --

More information about the Python-list mailing list