[issue46896] add support for watching writes to selected dictionaries
Mark Shannon
report at bugs.python.org
Tue Mar 15 12:16:21 EDT 2022
Mark Shannon <mark at hotpy.org> added the comment:
Let me give you an example.
#module eggs
eggs_var = 0 # a variable, maybe a counter or similar
EGGS_CONST # a constant
#module spam
import eggs
spam_var # Another variable
def foo():
use(eggs.EGGS_CONST)
-------------
We will want to treat `eggs.EGGS_CONST` as a constant.
To do that we need to be notified if `spam.eggs` or `eggs.EGGS_CONST` changes, but we do not want be notified whenever `spam.spam_var` or `eggs.eggs_var` changes.
This might not be necessary for us right now, but we will want to implement optimizations over larger regions than a single bytecode in 3.12.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46896>
_______________________________________
More information about the Python-bugs-list
mailing list