> That's just what I'd like and I suppose can't be currently done with
> current ABC, PyProtocols or zope.interface implementations, right?

It can. With __instancecheck__ you can override isinstance. It is
possible (for example) to write a subclass of abc.ABCMeta, which
extends __instancecheck__ to use an _instancehook classmethod
similarly to __subclasshook__. Then in your MyInterface class you can
implement _instancehook to check for methods/signatures/whatever you
want.


Daniel
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to