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 ncoghlan
Recipients ncoghlan
Date 2013-01-01.03:38:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1357011504.56.0.782130595735.issue16832@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-01-01 03:38:24ncoghlansetrecipients: + ncoghlan
2013-01-01 03:38:24ncoghlansetmessageid: <1357011504.56.0.782130595735.issue16832@psf.upfronthosting.co.za>
2013-01-01 03:38:24ncoghlanlinkissue16832 messages
2013-01-01 03:38:23ncoghlancreate