[Python-Dev] [Python-checkins] cpython: Close #17828: better handling of codec errors

Walter Dörwald walter at livinglogic.de
Tue Nov 19 13:24:19 CET 2013

On 15.11.13 00:02, Greg Ewing wrote:

> Walter Dörwald wrote:
>> Unfortunaty the frame from the decorator shows up in the traceback.
> Maybe the decorator could remove its own frame from
> the traceback?

True, this could be done via either an additional attribute on the 
frame, or a special value for frame.f_annotation.

Would we want to add frame annotations to every function call in the 
Python stdlib? Certainly not. So which functions would get annotations 
and which ones won't?

When we have many annotations, doing it with a decorator might be a 
performance problem, as each function call goes through another stack level.

Is there any other way to implement it?


More information about the Python-Dev mailing list