[issue5405] There is no way of determining which ABCs a class is registered against

Nick Coghlan report at bugs.python.org
Mon Mar 2 22:01:20 CET 2009


Nick Coghlan <ncoghlan at gmail.com> added the comment:

While a complete solution isn't possible, at least supporting querying
of explicit registrations would be an improvement over the status quo
(since an implicit registration can always be turned into an explicit
one, but a registration can't always be turned into inheritance).

For this to work in practice, I believe a PEP would be needed to add a
"subscribe" method to ABCMeta instances - this method would accept two
callbacks, one that was called whenever register() was invoked, and a
second when unregister() was invoked. Generic functions which add ABCs
registered could then subscribe to them and update their type caches
appropriately.

----------
nosy: +ncoghlan

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5405>
_______________________________________


More information about the Python-bugs-list mailing list