23 Jan
2014
23 Jan
'14
9:08 a.m.
On 23 January 2014 08:57, Nick Coghlan
The main problem with the idea of doing this as a more general feature for arbitrary callables is that it has most of the same downsides as monkey-patching while being strictly less powerful and even more confusing (since it would be difficult to model clearly in tracebacks).
Also, this would add overhead to all function calls (even if no before/after functions exist, checking the lists has a small cost) and function call overhead is already higher than many people would like. Paul