Message81222
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. |
|
Date |
User |
Action |
Args |
2009-02-05 20:03:23 | ncoghlan | set | recipients:
+ ncoghlan, doerwalter, paul.moore, ryan.freckleton |
2009-02-05 20:03:23 | ncoghlan | set | messageid: <1233864203.64.0.725211739823.issue5135@psf.upfronthosting.co.za> |
2009-02-05 20:03:22 | ncoghlan | link | issue5135 messages |
2009-02-05 20:03:21 | ncoghlan | create | |
|