ace91d3
diff --git a/q.py b/q.py
ace91d3
index 1bf76d0..fcff4c9 100644
ace91d3
--- a/q.py
ace91d3
+++ b/q.py
ace91d3
@@ -294,8 +294,9 @@ def __call__(self, *args):
008c7ee
             lines = info.code_context[:info.index + 1]
008c7ee
 
008c7ee
         # If we see "@q" on a single line, behave like a trace decorator.
008c7ee
-        if lines[-1].strip().startswith('@') and args:
008c7ee
-            return self.trace(args[0])
008c7ee
+        for line in lines:
f57736d
+            if line.strip() in ('@q', '@q()') and args:
008c7ee
+                return self.trace(args[0])
008c7ee
 
008c7ee
         # Otherwise, search for the beginning of the call expression; once it
008c7ee
         # parses, use the expressions in the call to label the debugging output.