Walter Dörwald added the comment:

Here is a new version of the patch. The annotation is done on the code object 
instead of on the frame object. This avoids two problems: There is no runtime 
overhead, as the decorator returns the original function and no additional 
frames show up in the traceback. Since the variables are only known at runtime, 
the annotation is now a function that does the formatting of the annotation 
message and gets passed the frame object. With this there is no runtime 
overhead when no exception is raised and even if an exception is raise, but the 
traceback is never formatted.

----------
Added file: http://bugs.python.org/file32834/code-annotation.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19585>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to