Dave, thanks. > To me, even if Car happens to represent a dict by being able to be used > as a dict, the expression of this fact feels better expressed as merely > implementing dict. > > compare: > > class Car(dict): # car... is a dict? hmm, a bad ring to it > ... > > class Car: > implements dict # oh, Cars can be used like a dict, got it > ...
OK, I guess the difference is that, for me, (1) this doesn't happen a lot (ever?), and (2) I don't feel that the nuance here is important enough to add another mechanism to the language which needs to be supported. I'd rather just use type inheritance. > Without something like an implements declaration, if I ever > want to express a relationship to another class, but with different > internals, I am forced to first define an abstract class and then > inherit from that. With an implements declaration, I can say implements > dict and be free of inheriting any of its internal implementation. That's why it's important for Python to have a clear set of base interface types for people to use. > In the syntax sketch, an Implementation is basically a list of > types/class, methods, and other Implementation lists. That sounds a whole lot like a Python 2.5 class, to me. Bill _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
