This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark.Shannon
Recipients Dennis Sweeney, Mark.Shannon, barry, brandtbucher, carljm, dino.viehland, gregory.p.smith, gvanrossum, itamaro
Date 2022-03-10.10:52:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646909570.58.0.520161091299.issue46896@roundup.psfhosted.org>
In-reply-to
Content
There are three kinds of changes that we might want to watch (that I can think of right now):

1. Any change.
   Rather coarse and potentially expensive. Used by Cinder.
2. A new key being added (or a change to the keys version as a proxy).
   Useful for detect shadowing of builtins by module globals, would save the keys version check for the module dict in `LOAD_GLOBAL_BUILTINS` and a version check in some `LOAD_METHOD` specializations.
3. The value corresponding to a particular key.
   With this we could effectively convert both `LOAD_GLOBAL` specializations into a constant, given an effective way to de-optimize.


One way to support the three cases above would be to replace the dict version with a pointer to a data structure describing what it watched.
If the pointer is `NULL`, then nothing is being watched.
The data structure would need 2 bits to cover cases 1 and 2, and 1 bit (or byte) for each key in the dict keys (or case 1 could be implemented by setting all the bits for case 3).
History
Date User Action Args
2022-03-10 10:52:50Mark.Shannonsetrecipients: + Mark.Shannon, gvanrossum, barry, gregory.p.smith, carljm, dino.viehland, brandtbucher, Dennis Sweeney, itamaro
2022-03-10 10:52:50Mark.Shannonsetmessageid: <1646909570.58.0.520161091299.issue46896@roundup.psfhosted.org>
2022-03-10 10:52:50Mark.Shannonlinkissue46896 messages
2022-03-10 10:52:50Mark.Shannoncreate