On Fri, May 20, 2011 at 5:03 PM, Eric Snow <ericsnowcurrently@gmail.com>wrote:
The use case is that I want to be able to validate that a class implements all of the abstract methods of all the classes to which it has been registered.
If you're going down that road, would you be willing to write a patch for http://bugs.python.org/issue9731 along the way?
Interesting. I was motivated in a similar situation to write a validater in
On Mon, May 23, 2011 at 6:54 PM, Daniel Stutzbach <stutzbach@google.com>wrote: the same vein [1]. In fact, working on that is where I got thinking about something like __implements__. The class I wrote would work with registered classes in addition to subclasses, if there were such a mechanism. -eric [1] http://code.activestate.com/recipes/577711-validating-classes-and-objects-ag...
I don't have a programmatic way of discovering that set without asking
every class out there.
I agree it would be nice to have a way to ask a class "which ABCs do you implement?" It would be handy for introspection and debugging purposes.
-- Daniel Stutzbach