Message178725
ABCMeta uses an internal counter to invalidate the negative caches when a register() call changes the virtual inheritance graph. (A global count of register() calls is stored on ABCMeta, which ABCMeta.__instancecheck__ and ABCMeta.__subclasscheck__ then compare to a copy cached on the individual ABC)
To properly handle register() method calls on ABCs, generic function implementations also need a way to invalidate their own caches when that graph changes.
It seems like the simplest way to handle this would be to expose a read-only "ABCMeta.cache_token" property. Generic function implementations could then work the same way as ABCMeta itself: store explicit implementation registrations and a cache of derived implementations separately, and if a saved copy of the cache token doesn't match the current value of ABCMeta.cache_token, clear the derived cache. |
|
Date |
User |
Action |
Args |
2013-01-01 03:38:24 | ncoghlan | set | recipients:
+ ncoghlan |
2013-01-01 03:38:24 | ncoghlan | set | messageid: <1357011504.56.0.782130595735.issue16832@psf.upfronthosting.co.za> |
2013-01-01 03:38:24 | ncoghlan | link | issue16832 messages |
2013-01-01 03:38:23 | ncoghlan | create | |
|