diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-16 17:28:22 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-16 17:28:22 -0400 |
commit | 4eb5c21bf1394d9bcb5944ef5d3aab2642ac61a8 (patch) | |
tree | dbc77c2819e118f28de1614876ad6c45fa3b697c /tools.py | |
parent | 5fb850b72334fe61c72608bd74a8d3b792a800a5 (diff) | |
download | chroma-4eb5c21bf1394d9bcb5944ef5d3aab2642ac61a8.tar.gz chroma-4eb5c21bf1394d9bcb5944ef5d3aab2642ac61a8.tar.bz2 chroma-4eb5c21bf1394d9bcb5944ef5d3aab2642ac61a8.zip |
update documentation for tools.py
Diffstat (limited to 'tools.py')
-rw-r--r-- | tools.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -17,16 +17,18 @@ def debugger_hook(type, value, tb): pdb.pm() def enable_debug_on_crash(): - '''Start the PDB console when an uncaught exception propagates to the top.''' + "Start the PDB console when an uncaught exception propagates to the top." sys.excepthook = debugger_hook -# Allow profile decorator to exist, but do nothing if not running under kernprof +# allow profile decorator to exist, but do nothing if not running under +# kernprof try: profile_if_possible = profile except NameError: profile_if_possible = lambda x: x def timeit(func): + "A decorator to print the time elapsed in a function call." def f(*args, **kwargs): t0 = time.time() retval = func(*args, **kwargs) |