Author ncoghlan
Recipients doerwalter, ncoghlan, paul.moore, ryan.freckleton
Date 2009-02-05.20:03:20
SpamBayes Score 1.33405e-06
Marked as misclassified No
Message-id <1233864203.64.0.725211739823.issue5135@psf.upfronthosting.co.za>
In-reply-to
Content
Even more inconveniently, the existence of unregister() on ABCs makes it
difficult for the generic to cache the results of the isinstance()
checks (you don't want to be going through the chain of registered ABCs
every time calling isinstance(), since that would be painfully slow).

That said, it is already the case that if you only *register* with an
ABC, you don't get any of the methods - you have to implement them
yourself. It's only when you actually *inherit* from the ABC that the
methods are provided "for free". I guess the case isn't really any
different here - if you changed your example so that A inherited from C
and D rather than merely registering with them, then C & D would appear
in the MRO and the generic would recognise them.

So perhaps just documenting the limitation is the right answer after all.
History
Date User Action Args
2009-02-05 20:03:23ncoghlansetrecipients: + ncoghlan, doerwalter, paul.moore, ryan.freckleton
2009-02-05 20:03:23ncoghlansetmessageid: <1233864203.64.0.725211739823.issue5135@psf.upfronthosting.co.za>
2009-02-05 20:03:22ncoghlanlinkissue5135 messages
2009-02-05 20:03:21ncoghlancreate