[Python-Dev] PEP 246, redux

Alex Martelli aleax at aleax.it
Tue Jan 11 10:39:30 CET 2005


On 2005 Jan 10, at 23:19, Phillip J. Eby wrote:
    ...
> As I said, after more thought, I'm actually less concerned about the 
> performance than I am about even remotely encouraging the combination 
> of Liskov violation *and* concrete adaptation

As per other msg, abstract classes have just the same issues as 
concrete ones.

If Ka-Ping Yee's idea (per Artima cmts on BDFL blog) of having 
interfaces supply template methods too ever flies, the issue would 
arise there, too (a BDFL comment with a -1 suggests it won't fly, 
though).

> targets.  But, if "after the dust settles" it turns out this is going 
> to be supported after all, then we can worry about the performance if 
> need be.
>
> Note, however, that your statements actually support the idea of *not* 
> adding a special case for Liskov violators.  If newer code uses 
> interfaces, the Liskov-violation mechanism is useless.  If older code 
> doesn't have __conform__, it cannot possibly *use* the 
> Liskov-violation mechanism.

Adding __conform__ to a class to raise a LiskovViolation when needed is 
a TINY change compared to the refactoring needed to use 
template-methods without subclassing.


Alex



More information about the Python-Dev mailing list