On 4/27/07, Barry Warsaw <[EMAIL PROTECTED]> wrote: > - - Attributes. Interfaces allow you to make assertions about > attributes, not just methods, while ABCs necessarily cover only methods.
Why can't they have data attributes as well? > - - With interfaces, you can make assertions about individual objects > which may be different than what their classes assert. Interface > proponents seem to care a lot about this and it seems there are valid > uses cases for it. Isn't this something that could be handled by overriding isinstance? > Another example of separating inheritance and interface comes up when > you want to derive a subclass to share implementation details, but > you want to subtly change the semantics, which would invalidate an > ABC claim by the base class. Something like a GrowOnlyDictionary > that derived from dict for implementation purposes, but didn't want > to implement __delitem__ as required by the MutableMapping ABC. OK, that makes the isubclass override trickier, so there should be an example, but I think it can still be done. > Finally, I'm concerned with the "weight" of adding ABCs to all the > built-in types. What if the builtin types did not initially derive from any ABC, but were added (through an issubclass override) when the abc module was imported? -jJ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com