From e0e3537b41bcf53cb6c5611539c97d0edd81bd63 Mon Sep 17 00:00:00 2001 From: romanstingler Date: Sat, 27 Sep 2014 18:33:56 +0200 Subject: [PATCH] Update julia1_nopil.py Using __name__ is the preferred method as it applies uniformly. Unlike func_name, it works on built-in functions as well. Also the double underscores indicate to the reader this is a special attribute. As a bonus, classes and modules have a __name__ attribute too, so you only have remember one special name. --- 01_profiling/cpu_profiling/julia1_nopil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01_profiling/cpu_profiling/julia1_nopil.py b/01_profiling/cpu_profiling/julia1_nopil.py index 2d184c2..1584480 100644 --- a/01_profiling/cpu_profiling/julia1_nopil.py +++ b/01_profiling/cpu_profiling/julia1_nopil.py @@ -51,7 +51,7 @@ def calc_pure_python(draw_output, desired_width, max_iterations): output = calculate_z_serial_purepython(max_iterations, zs, cs) end_time = time.time() secs = end_time - start_time - print calculate_z_serial_purepython.func_name + " took", secs, "seconds" + print calculate_z_serial_purepython.__name__ + " took", secs, "seconds" # this sum is expected for 1000^2 grid with 300 iterations assert sum(output) == 33219980