Brandt Bucher <brandtbuc...@gmail.com> added the comment:

> Why so coarse?

> Getting a notification for every change of a global in module, is likely to 
> make use the use of global variables extremely expensive.

Perhaps a compromise is possible here: one global group/chain of callbacks 
registered for all dictionaries in an interpreter seems reasonable (to keep 
overhead low), but we could reduce the number of times it’s actually called by, 
say, tagging specific values of specific dictionaries to be watched.

For example, we could just tag the low bit of any pointer in a dictionary’s 
values that we want to be notified of changes to. Something like that seems 
like it could really keep the cost of watching down without sacrificing power.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46896>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to