On 2/20/06, Brett Cannon <[EMAIL PROTECTED]> wrote:
> While #3 is my preferred solution as well, it does pose a Liskov
> violation if this is a direct dict subclass instead of storing a dict
> internally (can't remember the name of the design pattern that does
> this).  But I think it is good to have the constructor be different
> since it does also help drive home the point that this is not a
> standard dict.

I've heard this argument a few times now from different folks and I'm
tired of it. It's wrong. It's not true. It's a dead argument. It's
pushing up the daisies, so to speak.

Please stop abusing Barbara Liskov's name and remember that the
constructor signature is *not* part of the interface to an instance!
Changing the constructor signature in a subclass does *not* cause
*any* "Liskov" violations because the constructor is not called by
*users* of the object -- it is only called to *create* an object. As
the *user* of an object you're not allowed to *create* another
instance (unless the object provides an explicit API to do so, of
course, in which case you deal with that API's signature, not with the
constructor).

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to