A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2017-September/149634.html below:

[Python-Dev] API design question: how to extend sys.settrace()?

[Python-Dev] API design question: how to extend sys.settrace()? [Python-Dev] API design question: how to extend sys.settrace()?Serhiy Storchaka storchaka at gmail.com
Wed Sep 27 11:10:20 EDT 2017
27.09.17 15:56, Victor Stinner пише:
> In bpo-29400, it was proposed to add the ability to trace not only
> function calls but also instructions at the bytecode level. I like the
> idea, but I don't see how to extend sys.settrace() to add a new
> "trace_instructions: bool" optional (keyword-only?) parameter without
> breaking the backward compatibility. Should we add a new function
> instead?

I afraid that this change breaks an assumption in frame_setlineno() 
about the state of the stack. This can corrupt the stack if you jump 
from the instruction which is a part of Python operation. For example 
FOR_ITER expects an iterator on the stack. If you jump to the end of the 
loop from the middle of an assignment operator and skip say STORE_FAST, 
you will left an arbitrary value on the stack. This can lead to 
unpredictable consequences.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4