Is there something similar to `set -v` of bash in python

Chris Angelico rosuav at gmail.com
Sat Sep 17 23:50:10 EDT 2016


On Sun, Sep 18, 2016 at 1:08 PM, Peng Yu <pengyu.ut at gmail.com> wrote:
> The manual says the following.
>
> "The trace function is invoked (with event set to 'call') whenever a
> new local scope is entered; it should return a reference to a local
> trace function to be used that scope, or None if the scope shouldn’t
> be traced."
>
> It means that one can not somehow settrace in one line and expect to
> get the trace function being called in the next line.
>
> So something like `set -v` in bash sounds not possible. Is it so?

Can you predict in advance that you might be using this? If so, you
can define a trace function, and then activate and deactivate it on
command (in any way you like).

ChrisA



More information about the Python-list mailing list