Hi, George Sakkis wrote: > On 11/13/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> Are you going to propose similar >> changes for all standard de-facto interfaces, like sequences, >> mappings, files etc.? > > No, I won't (at least not for now ;-)). Notice however that most > user-defined sequences, mappings, etc. usually don't start from > scratch; they either inherit from an existing type or from an > appropriate mixin.
I absolutely disagree. One advantage of the way Python handles protocols like sequences, mappings and file-likes is that you do not have to implement the entire protocol if all you want is a thing to be, say, indexable. In most cases I've come across, I did not need to use any special base class or mixin at all, partly because I didn't need the complete protocol anyway, partly for performance reasons, partly because the the behaviour of the class was so different from a list that there was no big gain in having a partial implementation. A superclass like UserDict etc. can be helpful, but requiring you to inherit from it seems plain wrong in my eyes. Stefan _______________________________________________ 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
