<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
For CPython, alternative 1 is to create a custom interpreter to change (wrap) the interpretation of the call-function bytecode in the ceval loop. That is its 'call event', and I believe this would catch every explicit f(args) call and only such calls.<br>

<br></blockquote><div><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Python has no general metasyntax for changing the semantics of its syntax. The __xx__ methods are special cases for the corresponding operators *and* the corresponding user-defined class. The '__call__' method of a class applies to instances of that class. Alternative 2:<br>

<br></blockquote><div><br>Terry thanks for your response. <br>

<br>

My hoped-for spec explicitly
prohibits wrapping required each (user-defined) function to be wrapped
individual, since I
want to be able to have this wrapping behavior apply to many functions
created by many users on the fly, and such users can't be asked to
remember to wrap each function.  (At most, they can be asked to set a
single evironment variable or the like at the beginning of modules or
interpreter sessions that should the "turn on wrapping" for all future
function calls.) <br>


<br>

So I suppose the situation is as I feared? That the only way to
achieve my goal without having to wrap every (user-defined) function
call individually is to modify the interpreter.   Is there no way to
edit frame objects from inside a function?  if I could do that in a
settrace function, would it even help? <br>


<br>

Also: am I right in thinking that the "modified interpreter"
approach would mean that my resulting software couldn't be used as a
3-rd party module, that could be easily integrated into existing python
installations?  Or is there some standard way of integrating
dynamically loadable modifications to the interpreter in python?  (e.g.
so that users of my code wouldn't have to re-install of their existing
modules in a separate new python installation?)<br>


<br>

Thanks!<br>

<font color="#888888">Dan</font><br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
</blockquote>
<br>
<br></div><div><div></div><div class="h5">
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>